错误npm并发安装lite-server typescript

时间:2016-09-21 03:54:10

标签: angularjs node.js npm-install

我试图修复npm在angular的快速启动时遇到麻烦,所以我尝试安装这些依赖项。不幸的是,我遇到了这些错误消息:

$ sudo npm install -g concurrently lite-server typescript
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "concurrently" "lite-server" "typescript"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.8

npm ERR! uid must be an unsigned int
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "concurrently" "lite-server" "typescript"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.8

[14 - 16 of this repeatedly appears]

npm ERR! uid must be an unsigned int
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!     /Users/username/npm-debug.log

我不知道这意味着什么,因为我只是一个初学者。

2 个答案:

答案 0 :(得分:0)

您必须重新安装node.js包 node.js

它解决了我的问题

答案 1 :(得分:0)

有几种方法可以解决这个问题。它与权限有关。 下面列出了两种解决方案的摘要:

解决方案A:

(1)在/ Users // as / Users // npm-global

下创建npm-global目录

(2)npm config set prefix / Users // npm-global

(3)添加导出PATH = / Users // npm-global / bin:$ PATH到〜/ .profile

(4)source~ / .profile

(5)如果你不想做步骤(3)&amp; (4)将导出注释添加到〜/ .bash_profile

解决方案B:

(1)sudo chown -R $ USER / usr / local /

点击链接https://docs.npmjs.com/getting-started/fixing-npm-permissions了解详情