首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用以下命令创建新的sails项目时出现NPM错误: sails new test-project

使用以下命令创建新的sails项目时出现NPM错误: sails new test-project
EN

Stack Overflow用户
提问于 2018-07-29 15:17:38
回答 1查看 494关注 0票数 0

我对sails js非常陌生。我刚刚在本地计算机上全局安装了sails,当我尝试使用命令"sails new test- project“创建一个新项目时,它只是失败了。每次都会失败,错误出在NPM的某个地方。

以下是命令提示符中的详细信息。

代码语言:javascript
复制
Failed to install dependencies.
New app was generated successfully, but some dependencies 
in node_modules/ are probably still incomplete or missing.

Before you continue, please make sure you are connected to the
internet, and that your NPM registry hasn't gone down.
Then cd into the new app and run:
    rm -rf node_modules && npm install

See below for complete error details.
For more help, visit https://sailsjs.com/support.

error: { 

Error: Command failed: npm install
npm WARN deprecated mailcomposer@2.1.0: This project is unmaintained

npm WARN deprecated coffee-script@1.10.0: CoffeeScript on NPM has moved to
  "coffeescript" (no hyphen)

npm WARN deprecated buildmail@2.0.0: This project is unmaintained

npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading
  Browserslist >3.0 config used in other tools.

npm WARN deprecated sprintf@0.1.5: The sprintf package is deprecated in
  favor of sprintf-js.

npm WARN deprecated uws@9.14.0: stop using this version

npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at
  least 2.1.6 to avoid a serious bug with socket data flow and
  an import issue introduced in 2.1.0

npm WARN notice [SECURITY] lodash has the following vulnerability:
1 low. Go here for more details:
  https://nodesecurity.io/advisories?search=lodash&version=3.10.1 
  - Run `npm i npm@latest -g` to upgrade your npm version, and
    then `npm audit` to get more info.

npm WARN tar ENOENT: no such file or directory, open
  'E:\workspace\matallica\backenD\node_modules\.staging\sails-generate-5ef564b7\lib\builtins\copy\index.js'

npm WARN tar ENOENT: no such file or directory, open 
  'E:\workspace\matallica\backenD\node_modules\.staging\statuses-8d66e757\index.js'

npm WARN tar ENOENT: no such file or directory, open 
  'E:\workspace\matallica\backenD\node_modules\.staging\statuses-8d66e757\HISTORY.md'

npm WARN tar ENOENT: no such file or directory, open 
  'E:\workspace\matallica\backenD\node_modules\.staging\statuses-8d66e757\codes.json'

npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. 

You must install peer dependencies yourself.

npm ERR! code EINTEGRITY

npm ERR! sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== 
  integrity checksum failed when using sha512: wanted sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== 
  but got sha512-tuJp5MrQL1Q4DGVO5CQN6FghjuWqnA6mURYP+s8UFEV3ezesOPSE3F9F/47+dLvOXPfulVuk729nHGYpVaS1ag==. (742 bytes)

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\admin\AppData\Roaming\npm-cache\_logs\2018-07-29T08_32_47_710Z-debug.log

    at ChildProcess.exithandler (child_process.js:275:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:557:12) killed:
        false, code: 1, signal: null, cmd: 'npm install' }
EN

回答 1

Stack Overflow用户

发布于 2018-07-29 18:05:10

删除包-lock.json rm package-lock.json和node_modules rm -rf node_modules

尝试执行以下命令:

代码语言:javascript
复制
npm cache clean

sudo npm install

现在试试你的命令:

代码语言:javascript
复制
sails new test-project
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51578147

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档