NPM错误在Sails js上创建新应用程序

时间:2016-01-24 20:05:04

标签: node.js npm sails.js

我更新了nodejs,npm和sails。我目前的版本是:

$ node -v: 5.5.0
$ npm -v: 3.3.12
$ sails -v: 0.11.4

这是我创建新应用时的日志:

$ sails new npmtest
Installing dependencies... (this could take a while)
npm WARN deprecated lodash@0.9.2: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0
npm WARN deprecated grunt-lib-contrib@0.7.1: DEPRECATED. See readme: https://github.com/gruntjs/grunt-lib-contrib
npm WARN deprecated lodash@1.0.2: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0
npm WARN skippingAction Module is inside a symlinked module: not running add core-util-is@1.0.2 node_modules/core-util-is
npm WARN skippingAction Module is inside a symlinked module: not running add minimist@1.1.1 node_modules/geojsonhint/node_modules/minimist
npm WARN skippingAction Module is inside a symlinked module: not running add isarray@0.0.1 node_modules/isarray
npm WARN skippingAction Module is inside a symlinked module: not running add JSV@4.0.2 node_modules/JSV
npm WARN skippingAction Module is inside a symlinked module: not running add underscore@1.6.0 node_modules/nomnom/node_modules/underscore
...
info: Created a new Sails app `npmtest`!

完美,然后是$ cd npmtest$ sails lift

这是日志:

Starting app...

module.js:341
    throw err;
    ^

Error: Cannot find module 'validator'

我正在尝试手动安装“验证器”,但我得到了:

$ npm install validator
npm WARN skippingAction Module is inside a symlinked module: not running add core-util-is@1.0.2 node_modules/core-util-is
npm WARN skippingAction Module is inside a symlinked module: not running add minimist@1.1.1 node_modules/geojsonhint/node_modules/minimist
npm WARN skippingAction Module is inside a symlinked module: not running add isarray@0.0.1 node_modules/isarray
npm WARN skippingAction Module is inside a symlinked module: not running add JSV@4.0.2 node_modules/JSV
npm WARN skippingAction Module is inside a symlinked module: not running add underscore@1.6.0 node_modules/nomnom/node_modules/underscore
...
npmtest@0.0.0 /Users/Sites/npmtest
└── validator@4.5.1  extraneous

但现在帆上升,答案是一样的:

Starting app...

module.js:341
    throw err;
    ^

Error: Cannot find module 'validator'

我做错了什么?这不是我的第一个风帆应用程序。我曾经使用过新的应用程序生成器docens。

1 个答案:

答案 0 :(得分:3)

这是因为您的全局安装包含未更新的包。

完全删除您的SailsJS安装并重新安装。