相关疑难解决方法(0)

我如何更新Node.js?

我做了以下更新我的npm:

npm update npm -g
Run Code Online (Sandbox Code Playgroud)

但我不知道如何更新Node.js. 有什么建议?(我正在使用Node.js 0.4.1并希望更新到Node.js 0.6.1.)

software-update node.js

743
推荐指数
20
解决办法
160万
查看次数

如何更新npm

我正在尝试安装mean.io样板.运行时失败sudo npm install -g meanio@latest.在失败之前,它注意到它'想要'npm版本1.4.x,而我已经安装了1.2.18.所以我尝试将npm更新到最新版本; 几种方式.最后一个是......

ubuntu@ip-xxx-xx-xx-xxx:~$ sudo npm install -g npm
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
npm@1.4.7 /usr/local/lib/node_modules/npm

ubuntu@ip-xxx-xx-xx-xxx:~$ npm --version
1.2.18
Run Code Online (Sandbox Code Playgroud)

当我刚刚更新到1.4.7时,为什么它仍然显示版本1.2.18?

ubuntu npm

119
推荐指数
8
解决办法
17万
查看次数

npm update打破了npm

我只是按照本指南更新npm(因为我的nodered相机模块不工作)并运行

npm install -g npm
Run Code Online (Sandbox Code Playgroud)

但现在我的npm安装似乎完全坏了.如果我只是打字

npm
Run Code Online (Sandbox Code Playgroud)

要么

npm update
Run Code Online (Sandbox Code Playgroud)

我明白了

/usr/local/lib/node_modules/npm/bin/npm-cli.js:79让notifier = require('update-notifier')({pkg})^^^

SyntaxError:在严格模式之外尚不支持块范围的声明(let,const,function,class)

我试过了

sudo apt-get remove npm
sudo apt-get install npm
Run Code Online (Sandbox Code Playgroud)

但重新安装并没有帮助.

我认为我的节点版本需要从v4.8.2升级,但我认为这只能用npm进行?

linux node.js npm

29
推荐指数
2
解决办法
4万
查看次数

angularjs2快速入门指南错误404'angular'不在npm注册表中

我最近克隆了官方的AngularJS Quickstart代码并运行了npm install.我收到了404.错误404'angular'不在npm注册表中.这是我的npm调试日志:

    17 silly registry.get     'content-length': '40',
517 silly registry.get     'accept-ranges': 'bytes',
517 silly registry.get     date: 'Tue, 10 May 2016 15:00:17 GMT',
517 silly registry.get     via: '1.1 varnish',
517 silly registry.get     age: '0',
517 silly registry.get     connection: 'keep-alive',
517 silly registry.get     'x-served-by': 'cache-sin6927-SIN',
517 silly registry.get     'x-cache': 'MISS',
517 silly registry.get     'x-cache-hits': '0',
517 silly registry.get     'x-timer': 'S1462892417.310196,VS0,VE210' } ]
518 silly lockFile b50e344d-angular-core-2-0-0-rc-1 angular/core@2.0.0-rc.1
519 silly lockFile b50e344d-angular-core-2-0-0-rc-1 angular/core@2.0.0-rc.1
520 error 404 'angular' is not in the npm …
Run Code Online (Sandbox Code Playgroud)

npm angular

21
推荐指数
2
解决办法
2万
查看次数

我怎样才能更新npm本身?

我正在尝试更新npm本身:

npm uninstall npm -g
Run Code Online (Sandbox Code Playgroud)

回复:

unbuild npm@2.12.1
Run Code Online (Sandbox Code Playgroud)

但是当我走的时候:

npm --version
Run Code Online (Sandbox Code Playgroud)

我得到1.4.28?如何升级npm本身

windows node.js npm

18
推荐指数
3
解决办法
9290
查看次数

弃用警告:由于安全和可用性问题,不推荐使用 Buffer()。请改用 Buffer.alloc(), ... 方法

我有一个 angular 项目,最近我使用以下命令向它添加了 angular-universal:

ng add @nguniversal/express-engine --clientProject {{ name of your project }}
Run Code Online (Sandbox Code Playgroud)

构建和运行它:

npm run build:ssr && npm run serve:ssr
Run Code Online (Sandbox Code Playgroud)

这样做后我遇到了很多错误,但我设法让它正常工作,但是当我访问我的主页时,它将以下内容写入控制台:

(node:44714) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
ERROR [Error]
ERROR [Error]
Run Code Online (Sandbox Code Playgroud)

每次我刷新页面时,它都会在ERROR [Error]没有任何细节的情况下再次打印,请注意new Buffer()我的代码中没有任何内容,并且我已经按照堆栈溢出的建议解决了这个问题,但没有运气,有人可以帮助弄清楚是什么吗造成这个?


我已经ERROR [Error]通过删除 TranslateService解决了这个问题,但仍然有 deprecationWarning

angular-universal angular

16
推荐指数
1
解决办法
3万
查看次数

您不能在以前发布的版本上发布

我已经使用更新了我的包npm version minor去从0.4.0到0.5.0,无一不package.jsonpackage-lock.json反映这一点。但是,当我运行npm publish命令时,它说:

您不能在以前发布的版本上发布:0.4.0

是否还有其他地方需要更新 semver 才能发布?

npm npm-publish

14
推荐指数
5
解决办法
1万
查看次数

Npm成功更新,但仍然显示旧版本

当我这样做时,npm -v我发现我仍然在使用5.6.0.并不断得到提示做一个npm i npm.

但是我已经做了一次sudo npm install npm@latest -g双重检查,npm outdated -g --depth=0看到我的全球npm已经是最新的(6.0.0)了.

我该如何解决这个冲突?npm我使用的是最新的还是旧的?是因为我的全局链接不正确还是什么?

npm

12
推荐指数
5
解决办法
9823
查看次数

使用apt-get进行安装时,为什么会获得旧版本的nodejs和npm?

我在Ubuntu 14.04 64位中执行了以下命令.

sudo apt-get update
sudo apt-get install nodejs modejs-legacy npm
Run Code Online (Sandbox Code Playgroud)

我有版本

npm -v
1.3.10

nodejs -v
v0.10.25
Run Code Online (Sandbox Code Playgroud)

这些比AngularJS 2的推荐版本旧.

为什么apt-get下载旧版本?如何更新到更新版本?

ubuntu apt-get node.js npm

11
推荐指数
2
解决办法
4536
查看次数

angular2 quickstart npm安装失败

当我尝试运行npm install时出现以下错误.错误如下:

npm ERR! node v0.12.12
npm ERR! npm  v3.3.6
npm ERR! code ELIFECYCLE
npm ERR! angular2-quickstart@1.0.0 postinstall: `typings install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-quickstart@1.0.0 postinstall script 'typings ins
tall'.
npm ERR! This is most likely a problem with the angular2-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     typings install
npm ERR! You can get their info via:
npm …
Run Code Online (Sandbox Code Playgroud)

node.js exitstatus angular

9
推荐指数
1
解决办法
6323
查看次数