通过以下命令在创建新的sails项目时出现NPM错误:sails new test-project

时间:2018-07-29 07:17:38

标签: node.js npm sails.js npm-scripts

我对Sails JS非常陌生。我刚刚在本地计算机上全局安装了sails,当我尝试使用“ sails new test-project”命令创建新项目时,它只是失败了。而且每次都会失败,错误可能出在NPM。

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

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' }

1 个答案:

答案 0 :(得分:0)

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

尝试以下命令:

npm cache clean

sudo npm install

现在尝试您的命令:

sails new test-project