我无法安装sailsjs并使其在Windows机器上正常运行。我已经用osx试过了,我没有问题。我正在使用风帆0.11.3
我安装了 - node.js 4.2.4 - python 2.7.10 - 2012年视觉工作室快递
(最后两个我发现依赖包node-gyp需要)
然后我跑
C:\Users\MP>npm -g install sails
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://git
hub.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
> sails@0.11.3 preinstall C:\Users\IBM_ADMIN\AppData\Roaming\npm\node_modules\.s
taging\sails-5f66cf84
> node ./lib/preinstall_npmcheck.js
Sails.js Installation: Checking npm-version successful
C:\Users\IBM_ADMIN\AppData\Roaming\npm\sails -> C:\Users\IBM_ADMIN\AppData\Roami
ng\npm\node_modules\sails\bin\sails.js
- handlebars node_modules\sails\node_modules\express-handlebars\node_modules\han
dlebars
- chalk node_modules\sails\node_modules\grunt-contrib-coffee\node_modules\chalk
- chalk node_modules\sails\node_modules\grunt-contrib-cssmin\node_modules\chalk
- maxmin node_modules\sails\node_modules\grunt-contrib-cssmin\node_modules\maxmi
n
- chalk node_modules\sails\node_modules\grunt-contrib-jst\node_modules\chalk
- grunt-lib-contrib node_modules\sails\node_modules\grunt-contrib-jst\node_modul
es\grunt-lib-contrib
- maxmin node_modules\sails\node_modules\grunt-contrib-jst\node_modules\grunt-li
b-contrib\node_modules\maxmin
- chalk node_modules\sails\node_modules\grunt-contrib-less\node_modules\chalk
- less node_modules\sails\node_modules\grunt-contrib-less\node_modules\less
- maxmin node_modules\sails\node_modules\grunt-contrib-less\node_modules\maxmin
- chalk node_modules\sails\node_modules\grunt-contrib-uglify\node_modules\chalk
- maxmin node_modules\sails\node_modules\grunt-contrib-uglify\node_modules\maxmi
n
- tiny-lr node_modules\sails\node_modules\grunt-contrib-watch\node_modules\tiny-
lr
- noptify node_modules\sails\node_modules\grunt-contrib-watch\node_modules\tiny-
lr\node_modules\noptify
- js-yaml node_modules\sails\node_modules\grunt\node_modules\js-yaml
- utile node_modules\sails\node_modules\prompt\node_modules\utile
- sails-generate-new node_modules\sails\node_modules\sails-generate\node_modules
\sails-generate-new
C:\Users\IBM_ADMIN\AppData\Roaming\npm
└─┬ sails@0.11.3
├─┬ express-handlebars@1.0.3
│ └─┬ handlebars@2.0.0
│ └─┬ uglify-js@2.3.6
│ └── async@0.2.10
├─┬ grunt-contrib-less@0.11.1
│ ├── async@0.2.10
│ └─┬ less@1.7.5
│ └─┬ clean-css@2.2.23
│ └── commander@2.2.0
├─┬ grunt-contrib-uglify@0.4.1
│ └─┬ uglify-js@2.6.1
│ └── async@0.2.10
├─┬ grunt-contrib-watch@0.5.3
│ └─┬ tiny-lr@0.0.4
│ ├── debug@0.7.4
│ └── qs@0.5.6
├─┬ prompt@0.2.14
│ ├─┬ utile@0.2.1
│ │ └── async@0.2.10
│ └─┬ winston@0.8.3
│ └── async@0.2.10
├─┬ sails-disk@0.10.8
│ └── async@0.2.10
├─┬ sails-generate@0.12.4
│ ├── async@0.2.10
│ └─┬ sails-generate-api@0.10.0
│ └── async@0.2.10
└─┬ sails-hook-sockets@0.11.28
├─┬ socket.io@1.3.7
│ ├─┬ socket.io-adapter@0.3.1
│ │ └─┬ socket.io-parser@2.2.2
│ │ └── debug@0.7.4
│ └─┬ socket.io-parser@2.2.4
│ └── debug@0.7.4
└─┬ socket.io-client@1.3.7
└── debug@0.7.4
它似乎没有问题,但有几个已弃用的库。
当我尝试运行sails new projectName时,它会在创建项目时奇怪地启动(并且失败)安装一些依赖项:
C:\Users\IBM_ADMIN>sails new testProject
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://git
hub.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 update
handlebars@2.0.0 node_modules\sails\node_modules\express-handlebars\node_modules
\handlebars
npm WARN skippingAction Module is inside a symlinked module: not running update
chalk@0.4.0 node_modules\sails\node_modules\grunt-contrib-coffee\node_modules\ch
alk
npm WARN skippingAction Module is inside a symlinked module: not running update
chalk@0.4.0 node_modules\sails\node_modules\grunt-contrib-cssmin\node_modules\ch
alk
npm WARN skippingAction Module is inside a symlinked module: not running update
maxmin@0.1.0 node_modules\sails\node_modules\grunt-contrib-cssmin\node_modules\m
axmin
npm WARN skippingAction Module is inside a symlinked module: not running update
chalk@0.4.0 node_modules\sails\node_modules\grunt-contrib-jst\node_modules\chalk
npm WARN skippingAction Module is inside a symlinked module: not running update
grunt-lib-contrib@0.7.1 node_modules\sails\node_modules\grunt-contrib-jst\node_m
odules\grunt-lib-contrib
npm WARN skippingAction Module is inside a symlinked module: not running update
chalk@0.4.0 node_modules\sails\node_modules\grunt-contrib-less\node_modules\chal
k
npm WARN skippingAction Module is inside a symlinked module: not running add com
mander@2.2.0 node_modules\sails\node_modules\grunt-contrib-less\node_modules\com
mander
npm WARN skippingAction Module is inside a symlinked module: not running add cle
an-css@2.2.23 node_modules\sails\node_modules\grunt-contrib-less\node_modules\cl
ean-css
npm WARN skippingAction Module is inside a symlinked module: not running update
less@1.7.5 node_modules\sails\node_modules\grunt-contrib-less\node_modules\less
npm WARN skippingAction Module is inside a symlinked module: not running update
maxmin@0.1.0 node_modules\sails\node_modules\grunt-contrib-less\node_modules\max
min
npm WARN skippingAction Module is inside a symlinked module: not running update
chalk@0.4.0 node_modules\sails\node_modules\grunt-contrib-uglify\node_modules\ch
alk
npm WARN skippingAction Module is inside a symlinked module: not running update
maxmin@0.1.0 node_modules\sails\node_modules\grunt-contrib-uglify\node_modules\m
axmin
npm WARN skippingAction Module is inside a symlinked module: not running add deb
ug@0.7.4 node_modules\sails\node_modules\grunt-contrib-watch\node_modules\debug
npm WARN skippingAction Module is inside a symlinked module: not running add qs@
0.5.6 node_modules\sails\node_modules\grunt-contrib-watch\node_modules\qs
npm WARN skippingAction Module is inside a symlinked module: not running update
tiny-lr@0.0.4 node_modules\sails\node_modules\grunt-contrib-watch\node_modules\t
iny-lr
npm WARN skippingAction Module is inside a symlinked module: not running update
js-yaml@2.0.5 node_modules\sails\node_modules\grunt\node_modules\js-yaml
npm WARN skippingAction Module is inside a symlinked module: not running add asy
nc@0.2.10 node_modules\sails\node_modules\prompt\node_modules\async
npm WARN skippingAction Module is inside a symlinked module: not running update
utile@0.2.1 node_modules\sails\node_modules\prompt\node_modules\utile
npm WARN skippingAction Module is inside a symlinked module: not running move as
ync@1.5.1 node_modules\sails\node_modules\sails-generate\node_modules\sails-gene
rate-new\node_modules\async
npm WARN skippingAction Module is inside a symlinked module: not running move lo
dash@3.10.1 node_modules\sails\node_modules\sails-generate\node_modules\sails-ge
nerate-new\node_modules\lodash
npm WARN skippingAction Module is inside a symlinked module: not running add lod
ash@2.4.2 node_modules\sails\node_modules\sails-generate\node_modules\sails-gene
rate-new\node_modules\merge-defaults\node_modules\lodash
npm WARN skippingAction Module is inside a symlinked module: not running move me
rge-defaults@0.2.1 node_modules\sails\node_modules\sails-generate\node_modules\s
ails-generate-new\node_modules\merge-defaults
npm WARN skippingAction Module is inside a symlinked module: not running update
sails-generate-new@0.10.22 node_modules\sails\node_modules\sails-generate\node_m
odules\sails-generate-new
npm WARN skippingAction Module is inside a symlinked module: not running remove
maxmin node_modules\sails\node_modules\grunt-contrib-jst\node_modules\grunt-lib-
contrib\node_modules\maxmin
npm WARN skippingAction Module is inside a symlinked module: not running remove
noptify node_modules\sails\node_modules\grunt-contrib-watch\node_modules\tiny-lr
\node_modules\noptify
npm WARN skippingAction Module is inside a symlinked module: not running remove
handlebars@2.0.0 node_modules\sails\node_modules\handlebars
npm WARN skippingAction Module is inside a symlinked module: not running remove
sails-generate-new@0.10.22 node_modules\sails\node_modules\sails-generate-new
npm WARN skippingAction Module is inside a symlinked module: not running remove
lodash@2.4.2 node_modules\sails\node_modules\sails-generate-new\node_modules\mer
ge-defaults\node_modules\lodash
npm WARN skippingAction Module is inside a symlinked module: not running remove
utile@0.2.1 node_modules\sails\node_modules\utile
npm WARN install:clean-css@2.2.23 Refusing to delete C:\Users\IBM_ADMIN\testProj
ect\node_modules\sails\node_modules\less\node_modules\.bin\cleancss.cmd: contain
ing path C:\Users\IBM_ADMIN\testProject\node_modules\sails\node_modules\less\nod
e_modules\clean-css isn't under npm's control
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\IBM_ADMIN\\AppDa
ta\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.2.4
npm ERR! npm v3.5.2
npm ERR! path C:\Users\IBM_ADMIN\testProject\node_modules\sails\node_modules\.bi
n\tiny-lr.cmd
npm ERR! code EEXIST
npm ERR! Refusing to delete C:\Users\IBM_ADMIN\testProject\node_modules\sails\no
de_modules\.bin\tiny-lr.cmd: containing path C:\Users\IBM_ADMIN\testProject\node
_modules\sails\node_modules\tiny-lr isn't under npm's control
npm ERR! File exists: C:\Users\IBM_ADMIN\testProject\node_modules\sails\node_mod
ules\.bin\tiny-lr.cmd
npm ERR! Move it away, and try again.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\IBM_ADMIN\testProject\npm-debug.log
error: 1
有没有人遇到过这种行为?我该如何解决?
谢谢, 米歇尔。
答案 0 :(得分:0)
得到同样的错误并且让我的头撞了一会儿......
我为我工作的唯一解决方案是删除整个node_modules
库并运行install
所以命令是:
sails new YOUR_APP cd YOUR_APP rmdir /Q /S node_modules npm install sails lift
它不是永久的解决方案,但它有效
答案 1 :(得分:-1)
删除文件
C:\Users\IBM_ADMIN\testProject\node_modules\sails\node_modules\.bin\tiny-lr.cmd
再试一次