错误 npm install 同时 lite-server typescript

Posted

技术标签:

【中文标题】错误 npm install 同时 lite-server typescript【英文标题】:Error npm install concurrently lite-server typescript 【发布时间】:2017-01-29 03:44:14 【问题描述】:

我正在尝试修复 Angular 快速启动时的 npm start 问题,因此我尝试安装这些依赖项。不幸的是,我遇到了这些错误消息:

$ 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

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

【问题讨论】:

【参考方案1】:

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

它为我解决了问题

【讨论】:

【参考方案2】:

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

解决方案 A:

(1)/Users//下创建npm-global目录为/Users//npm-global

(2) npm config 设置前缀 /Users//npm-global

(3) 将 export PATH=/Users//npm-global/bin:$PATH 添加到 ~/.profile

(4) 来源 ~/.profile

(5) 如果您不想执行步骤 (3) & (4),请将导出注释添加到 ~/.bash_profile

解决方案 B:

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

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

【讨论】:

以上是关于错误 npm install 同时 lite-server typescript的主要内容,如果未能解决你的问题,请参考以下文章

npm install mongoose错误解决

npm 错误! npm install 时代码 EINTEGRITY

npm install 显示错误,找不到 git

npm 错误! npm install 时超出最大调用堆栈大小(角度)

npm install 错误

npm install 错误