[英]error while trying to install npm atob
I was trying to install npm atob in my project;but suddenly it is showing an error now as:我试图在我的项目中安装 npm atob;但突然它现在显示一个错误:
Linux 2.6.23.17-88.fc7
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "atob"
npm ERR! node v5.6.0
npm ERR! npm v3.8.8
npm ERR! code CERT_NOT_YET_VALID
npm ERR! certificate is not yet valid
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/www/project/npm-debug.log
but when i searched the most of them have answered as "Fix your system time"但是当我搜索时,大多数人的回答是“修复您的系统时间”
try to correct your system time before to get a valid certification.在获得有效认证之前尝试更正您的系统时间。 Else try to change the version of nodeJs否则尝试更改 nodeJs 的版本
sudo npm cache clean -f
sudo npm install -gn sudo n stable须藤 npm install -gn 须藤 n 稳定
The 'btoa-atob' module does not export a programmatic interface, it only provides command line utilities. 'btoa-atob' 模块不导出编程接口,它只提供命令行实用程序。 If you need to convert to Base64 you could do so using Buffer:如果您需要转换为 Base64,您可以使用 Buffer:
console.log(new Buffer('Hello World!').toString('base64'));
Reverse (assuming the content you're decoding is a utf8 string):反向(假设您正在解码的内容是 utf8 字符串):
console.log(new Buffer(b64Encoded, 'base64').toString());
The error code is CERT_NOT_YET_VALID -certificate is not yet valid, and it refers to ssl certificate.错误代码是CERT_NOT_YET_VALID -certificate is not valid, 它指的是 ssl 证书。
This should fix this error这应该解决这个错误
$ npm config set strict-ssl false
$ npm config set unsafe-perm true
$ npm config set registry http://registry.npmjs.org/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.