angular-cli新项目错误

时间:2016-10-14 13:10:32

标签: angular angular-cli

我运行ng new onepage几分钟后我得到以下错误:

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 minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated lodash-node@2.4.1: This package is discontinued. Use lodash@^4.0.0.
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 tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","         arch":"x64"})
npm WARN @angular/compiler-cli@0.6.4 requires a peer of @angular/platform-server@2.0.2 but none was installed.
npm WARN @angular/platform-server@2.1.0 requires a peer of @angular/core@2.1.0 but none was installed.
npm WARN @angular/platform-server@2.1.0 requires a peer of @angular/common@2.1.0 but none was installed.
npm WARN @angular/platform-server@2.1.0 requires a peer of @angular/compiler@2.1.0 but none was installed.
npm WARN @angular/platform-server@2.1.0 requires a peer of @angular/platform-browser@2.1.0 but none was installed.
npm ERR! Linux 4.4.0-31-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.8.0
npm ERR! npm  v3.10.8
npm ERR! path ../typescript/bin/tsc
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink

npm ERR! EPROTO: protocol error, symlink '../typescript/bin/tsc' -> '/vagrant/html/onepage/node_modules/@angular-cli/ast-tools/node_modules/.bin/tsc'
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!     /vagrant/html/onepage/npm-debug.log

我认为它是--no-bin-links并且我运行ng new onepage --no-bin-links,但我也有同样的错误。

任何人都可以帮助我吗?

2 个答案:

答案 0 :(得分:1)

首先使用命令

ng new project name --skip-install

skip-install标志将阻止安装npm软件包。

然后将目录更改为项目目录并运行命令

npm install --no-bin-links

希望这能解决您的问题。记得以root用户身份运行命令

答案 1 :(得分:0)

基于@mashqur的用户,请记住也以root用户身份运行ng serve,否则会收到错误ERROR in EPERM: operation not permitted