Angular-cli没有更新

时间:2016-10-05 08:30:26

标签: node.js angular

我需要将angular-cli更新为最新版本。 我跑的时候:

npm cache clean

我面临以下错误:

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "cache" "clean"
npm ERR! node v4.4.0
npm ERR! npm  v2.14.20
npm ERR! path C:\Users\Salman\AppData\Roaming\npm-cache
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rmdir

npm ERR! Error: EPERM: operation not permitted, rmdir 'C:\Users\Salman\AppData\Roaming\npm-cache'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM: operation not permitted, rmdir 'C:\Users\Salman\AppData\Roaming\npm-cache']
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rmdir',
npm ERR!   path: 'C:\\Users\\Salman\\AppData\\Roaming\\npm-cache' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Salman\Desktop\Nuroscience\dep1\npm-debug.log

此外,当我继续安装命令时:

npm install -g angular-cli@latest

我面对这个错误:

npm WARN peerDependencies The peer dependency webpack@* included from html-webpack-plugin will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated lodash.assign@4.2.0: This package is deprecated. Use Object.assign.
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130

> execSync@1.0.2 install C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\node_modules\angular2-template-loader\node_modules\codecov\node_modules\execSync
> node install.js

[execsync v1.0.2] Attempting to compile native extensions.
{ [Error: spawn node-gyp ENOENT]
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn node-gyp',
  path: 'node-gyp',
  spawnargs: [ 'rebuild' ] }
[execSync v1.0.2]
    Native code compile failed!!
    Will try to use win32 extension.
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN optional dep failed, continuing fsevents@1.0.14

> node-zopfli@2.0.1 install C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\node_modules\compression-webpack-plugin\node_modules\node-zopfli
> node-pre-gyp install --fallback-to-build

[node-zopfli] Success: "C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\node_modules\compression-webpack-plugin\node_modules\node-zopfli\lib\binding\node-v46-win32-x64\zopfli.node" is installed via remote
npm WARN deprecated lodash-node@2.4.1: This package is discontinued. Use lodash@^4.0.0.

> node-sass@3.10.1 install C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-sass
> node scripts/install.js

Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.10.1/win32-x64-46_binding.node
Binary downloaded and installed at C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-sass\vendor\win32-x64-46\binding.node

> node-sass@3.10.1 postinstall C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-sass
> node scripts/build.js

"C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-sass\vendor\win32-x64-46\binding.node" exists.
 testing binary.
Binary is fine; exiting.
C:\Users\Salman\AppData\Roaming\npm\ng -> C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\bin\ng
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "angular-cli@latest"
npm ERR! node v4.4.0
npm ERR! npm  v2.14.20
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package webpack@2.1.0-beta.22 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer html-webpack-plugin@2.22.0 wants webpack@*
npm ERR! peerinvalid Peer karma-webpack@1.8.0 wants webpack@^1.1.0 || ^2 || ^2.1.0-beta
npm ERR! peerinvalid Peer sass-loader@3.2.3 wants webpack@^1.12.6 || ^2.1.0-beta
npm ERR! peerinvalid Peer string-replace-loader@1.0.5 wants webpack@1 || 2 || ^2.0.0-beta || ^2.1.0-beta
npm ERR! peerinvalid Peer webpack-dev-server@2.1.0-beta.3 wants webpack@^2.1.0-beta

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Salman\Desktop\Nuroscience\dep1\npm-debug.log

那么,这个错误是什么,以及我如何解决它?

2 个答案:

答案 0 :(得分:1)

https://github.com/angular/angular-cli#updating-angular-cli

要将angular-cli更新为新版本,您必须更新全局包和项目的本地包,请按照链接

段:

Crashlytics.sharedInstance().crash()

注意:始终以管理员身份运行命令提示符,有时您必须多次运行npm uninstall -g angular-cli npm cache clean npm install -g angular-cli@latest ,直到错误消失为止

答案 1 :(得分:0)

您应该使用管理员运行cmd以允许清理缓存。一旦npm cache clean完成,您可以成功安装角度cli