node、 npm 都安装好了。但安装 express出问题了。 最后我又安装了一次,提示是OK的。 、、、
└── constantinople[@2](/user/2).0.1 (uglify-js[@2](/user/2).4.15) npm info ok Administrator[@MARKYUN](/user/MARKYUN) /d/nodejs $ express destination is not empty, continue? 。
后来 都已经安装好了,为什么会这个下面错误
Administrator[@MARKYUN](/user/MARKYUN) /d/nodejs
$ cp node_modules/candy/app.sample.js ./app.js
Administrator[@MARKYUN](/user/MARKYUN) /d/nodejs
> $ PORT=3001 node app.js
>
> module.js:340
> throw err;
> ^
> Error: Cannot find module 'express-scaffold'
> at Function.Module._resolveFilename (module.js:338:15)
> at Function.Module._load (module.js:280:25)
> at Module.require (module.js:364:17)
> at require (module.js:380:17)
> at Object.<anonymous> (d:\nodejs\node_modules\candy\index.js:11:14)
> at Module._compile (module.js:456:26)
> at Object.Module._extensions..js (module.js:474:10)
> at Module.load (module.js:356:32)
> at Function.Module._load (module.js:312:12)
> at Module.require (module.js:364:17)
我的操作过程:
1安装:node
2安装:npm
node cli.js install npm -gf
3安装:express
npm install -g express npm install -g express-generator
express -v
这里报错:express -v 提示: v未知的option。
然后我npm install -d
express -v
不报错了。但提示:
npm info ok Administrator@MARKYUN /d/nodejs $ express destination is not empty, continue?
然后
$ cp node_modules/candy/app.sample.js ./app.js
$ PORT=3001 node app.js
报错:Error: Cannot find module ‘express-scaffold’
为什么感觉你安装的这么麻烦,node不是自带了npm的了吗,不需要再重新安装的吧。我的也是win8
express 支持 -v 参数吗?使用 express --version 试试
这些错误是为什么尼(已经是管理员权限运行了):
> npm info linkStuff sinon[@1](/user/1).9.1
> npm info postinstall json-stringify-safe[@5](/user/5).0.0
> npm info install sinon[@1](/user/1).9.1
> npm info build d:\candy\candy\node_modules\express-scaffold\node_modules\less-mi
> ddleware\node_modules\less\node_modules\request\node_modules\aws-sign2
> npm info linkStuff aws-sign2[@0](/user/0).5.0
> npm info install aws-sign2[@0](/user/0).5.0
> npm info build d:\candy\candy\node_modules\express-scaffold\node_modules\less-mi
> ddleware\node_modules\less\node_modules\request\node_modules\forever-agent
> npm info linkStuff forever-agent[@0](/user/0).5.2
> npm info postinstall sinon[@1](/user/1).9.1
> npm info install forever-agent[@0](/user/0).5.2
> npm info postinstall aws-sign2[@0](/user/0).5.0
> npm info build d:\candy\candy\node_modules\express-scaffold\node_modules\node-sa
> ss
> npm info linkStuff node-sass[@0](/user/0).9.5-rc1
> npm info postinstall forever-agent[@0](/user/0).5.2
> npm info preinstall oauth-sign[@0](/user/0).3.0
> npm info preinstall form-data[@0](/user/0).1.4
> npm info preinstall tunnel-agent[@0](/user/0).4.0
> npm info build d:\candy\candy\node_modules\express-scaffold\node_modules\less-mi
> ddleware\node_modules\less\node_modules\request\node_modules\oauth-sign
> npm info linkStuff oauth-sign[@0](/user/0).3.0
> npm info install oauth-sign[@0](/user/0).3.0
> npm info preinstall stringstream[@0](/user/0).0.4
> npm info build d:\candy\candy\node_modules\express-scaffold\node_modules\less-mi
> ddleware\node_modules\less\node_modules\request\node_modules\tunnel-agent
> npm info linkStuff tunnel-agent[@0](/user/0).4.0
> npm info postinstall oauth-sign[@0](/user/0).3.0
> npm info install tunnel-agent[@0](/user/0).4.0
> npm info build d:\candy\candy\node_modules\express-scaffold\node_modules\less-mi
> ddleware\node_modules\less\node_modules\request\node_modules\stringstream
> npm info linkStuff stringstream[@0](/user/0).0.4
> npm info postinstall tunnel-agent[@0](/user/0).4.0
> npm info install stringstream[@0](/user/0).0.4
> npm info postinstall stringstream[@0](/user/0).0.4
> npm info install node-sass[@0](/user/0).9.5-rc1
> npm info trying registry request attempt 1 at 21:16:01
> npm http GET https://registry.npmjs.org/async
> npm info trying registry request attempt 1 at 21:16:01
> npm http GET https://registry.npmjs.org/combined-stream
>
>
> > node-sass[@0](/user/0).9.5-rc1 install d:\candy\candy\node_modules\express-scaffold\node_
> modules\node-sass
> > node build.js
>
> npm info node-sass[@0](/user/0).9.5-rc1 Failed to exec install script
> npm info node-sass[@0](/user/0).9.5-rc1 Failed to exec install script
> npm ERR! node-sass[@0](/user/0).9.5-rc1 install: `node build.js`
> npm ERR! spawn ENOENT
> npm ERR!
> npm ERR! Failed at the node-sass[@0](/user/0).9.5-rc1 install script.
> npm ERR! This is most likely a problem with the node-sass package,
> npm ERR! not with npm itself.
> npm ERR! Tell the author that this fails on your system:
> npm ERR! node build.js
> npm ERR! You can get their info via:
> npm ERR! npm owner ls node-sass
> npm ERR! There is likely additional logging output above.
>
> npm ERR! System Windows_NT 6.2.9200
> npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
> s\\node_modules\\npm\\bin\\npm-cli.js" "install" "-d"
> npm ERR! cwd d:\candy\candy
> npm ERR! node -v v0.10.32
> npm ERR! npm -v 1.4.28
> npm ERR! syscall spawn
> npm ERR! code ELIFECYCLE
> npm ERR! errno ENOENT
> npm info preuninstall kerberos[@0](/user/0).0.3
> npm info uninstall kerberos[@0](/user/0).0.3
> npm info postuninstall kerberos[@0](/user/0).0.3
> npm info preuninstall kerberos[@0](/user/0).0.3
> npm info uninstall kerberos[@0](/user/0).0.3
> npm info postuninstall kerberos[@0](/user/0).0.3
> npm info preuninstall bson[@0](/user/0).2.5
> npm info preinstall http-signature[@0](/user/0).10.0
> npm info uninstall bson[@0](/user/0).2.5
> npm info postuninstall bson[@0](/user/0).2.5
> npm info preinstall qs[@1](/user/1).0.2
> npm info build d:\candy\candy\node_modules\express-scaffold\node_modules\less-mi
> ddleware\node_modules\less\node_modules\request\node_modules\qs
> npm info linkStuff qs[@1](/user/1).0.2
> npm info install qs[@1](/user/1).0.2
> npm info postinstall qs[@1](/user/1).0.2
> npm info preinstall node-uuid[@1](/user/1).4.1
> npm info trying registry request attempt 1 at 21:16:01
> npm http GET https://registry.npmjs.org/assert-plus
> npm info trying registry request attempt 1 at 21:16:01
> npm http GET https://registry.npmjs.org/asn1
> npm info trying registry request attempt 1 at 21:16:01
> npm http GET https://registry.npmjs.org/ctype
> npm info build d:\candy\candy\node_modules\express-scaffold\node_modules\less-mi
> ddleware\node_modules\less\node_modules\request\node_modules\node-uuid
> npm info linkStuff node-uuid[@1](/user/1).4.1
> npm info install node-uuid[@1](/user/1).4.1
> npm info postinstall node-uuid[@1](/user/1).4.1
> npm info preuninstall bson[@0](/user/0).2.5
> npm info uninstall bson[@0](/user/0).2.5
> npm http 304 https://registry.npmjs.org/async
> npm info postuninstall bson[@0](/user/0).2.5
> npm info preinstall mime-types[@1](/user/1).0.2
> npm info build d:\candy\candy\node_modules\express-scaffold\node_modules\less-mi
> ddleware\node_modules\less\node_modules\request\node_modules\mime-types
> npm info linkStuff mime-types[@1](/user/1).0.2
> npm info install mime-types[@1](/user/1).0.2
> npm info postinstall mime-types[@1](/user/1).0.2
> npm info preuninstall node-sass[@0](/user/0).9.5-rc1
> npm info uninstall node-sass[@0](/user/0).9.5-rc1
> npm info postuninstall node-sass[@0](/user/0).9.5-rc1
> npm http 304 https://registry.npmjs.org/assert-plus
> npm http 304 https://registry.npmjs.org/ctype
> npm http 304 https://registry.npmjs.org/asn1
> npm info install assert-plus[@0](/user/0).1.2 into d:\candy\candy\node_modules\express-scaf
> fold\node_modules\less-middleware\node_modules\less\node_modules\request\node_mo
> dules\http-signature
> npm info install ctype[@0](/user/0).5.2 into d:\candy\candy\node_modules\express-scaffold\n
> ode_modules\less-middleware\node_modules\less\node_modules\request\node_modules\
> http-signature
> npm info install asn1[@0](/user/0).1.11 into d:\candy\candy\node_modules\express-scaffold\n
> ode_modules\less-middleware\node_modules\less\node_modules\request\node_modules\
> http-signature
> npm info installOne assert-plus[@0](/user/0).1.2
> npm info installOne ctype[@0](/user/0).5.2
> npm info installOne asn1[@0](/user/0).1.11
> npm info preuninstall express-scaffold[@0](/user/0).4.2
> npm info uninstall express-scaffold[@0](/user/0).4.2
> npm info postuninstall express-scaffold[@0](/user/0).4.2
> npm info preinstall assert-plus[@0](/user/0).1.2
> npm info build d:\candy\candy\node_modules\express-scaffold\node_modules\less-mi
> ddleware\node_modules\less\node_modules\request\node_modules\http-signature\node
> _modules\assert-plus
> npm info linkStuff assert-plus[@0](/user/0).1.2
> npm info install assert-plus[@0](/user/0).1.2
> npm info postinstall assert-plus[@0](/user/0).1.2
> npm ERR! Error: ENOENT, lstat 'd:\candy\candy\node_modules\express-scaffold\node
> _modules\less-middleware\node_modules\less\node_modules\request\node_modules\tou
> gh-cookie\lib\pubsuffix.js'
> npm ERR! If you need help, you may report this *entire* log,
> npm ERR! including the npm and node versions, at:
> npm ERR! <http://github.com/npm/npm/issues>
>
> npm ERR! System Windows_NT 6.2.9200
> npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
> s\\node_modules\\npm\\bin\\npm-cli.js" "install" "-d"
> npm ERR! cwd d:\candy\candy
> npm ERR! node -v v0.10.32
> npm ERR! npm -v 1.4.28
> npm ERR! path d:\candy\candy\node_modules\express-scaffold\node_modules\less-mid
> dleware\node_modules\less\node_modules\request\node_modules\tough-cookie\lib\pub
> suffix.js
> npm ERR! fstream_path d:\candy\candy\node_modules\express-scaffold\node_modules\
> less-middleware\node_modules\less\node_modules\request\node_modules\tough-cookie
> \lib\pubsuffix.js
> npm ERR! fstream_type File
> npm ERR! fstream_class FileWriter
> npm ERR! code ENOENT
> npm ERR! errno 34
> npm ERR! fstream_stack c:\Program Files\nodejs\node_modules\npm\node_modules\fst
> ream\lib\writer.js:287:26
> npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
> npm ERR! Error: ENOENT, lstat 'd:\candy\candy\node_modules\express-scaffold\node
> _modules\less-middleware\node_modules\less\node_modules\request\node_modules\htt
> p-signature\node_modules\asn1\lib\ber\writer.js'
> npm ERR! If you need help, you may report this *entire* log,
> npm ERR! including the npm and node versions, at:
> npm ERR! <http://github.com/npm/npm/issues>
>
> npm ERR! System Windows_NT 6.2.9200
> npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
> s\\node_modules\\npm\\bin\\npm-cli.js" "install" "-d"
> npm ERR! cwd d:\candy\candy
> npm ERR! node -v v0.10.32
> npm ERR! npm -v 1.4.28
> npm ERR! path d:\candy\candy\node_modules\express-scaffold\node_modules\less-mid
> dleware\node_modules\less\node_modules\request\node_modules\http-signature\node_
> modules\asn1\lib\ber\writer.js
> npm ERR! fstream_path d:\candy\candy\node_modules\express-scaffold\node_modules\
> less-middleware\node_modules\less\node_modules\request\node_modules\http-signatu
> re\node_modules\asn1\lib\ber\writer.js
> npm ERR! fstream_type File
> npm ERR! fstream_class FileWriter
> npm ERR! code ENOENT
> npm ERR! errno 34
> npm ERR! fstream_stack c:\Program Files\nodejs\node_modules\npm\node_modules\fst
> ream\lib\writer.js:287:26
> npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
> npm ERR! error rolling back Error: EPERM, unlink 'd:\candy\candy\node_modules\ex
> press-scaffold\node_modules\less-middleware\node_modules\less\node_modules\reque
> st\node_modules\http-signature\node_modules\ctype\ctio.js'
> npm ERR! error rolling back { [Error: EPERM, unlink 'd:\candy\candy\node_module
> s\express-scaffold\node_modules\less-middleware\node_modules\less\node_modules\r
> equest\node_modules\http-signature\node_modules\ctype\ctio.js']
> npm ERR! error rolling back errno: 50,
> npm ERR! error rolling back code: 'EPERM',
> npm ERR! error rolling back path: 'd:\\candy\\candy\\node_modules\\express-sca
> ffold\\node_modules\\less-middleware\\node_modules\\less\\node_modules\\request\
> \node_modules\\http-signature\\node_modules\\ctype\\ctio.js' }
> npm ERR! Error: ENOENT, lstat 'd:\candy\candy\node_modules\express-scaffold\node
> _modules\less-middleware\node_modules\less\node_modules\request\node_modules\htt
> p-signature\node_modules\ctype\ctio.js'
> npm ERR! If you need help, you may report this *entire* log,
> npm ERR! including the npm and node versions, at:
> npm ERR! <http://github.com/npm/npm/issues>
>
> npm ERR! System Windows_NT 6.2.9200
> npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
> s\\node_modules\\npm\\bin\\npm-cli.js" "install" "-d"
> npm ERR! cwd d:\candy\candy
> npm ERR! node -v v0.10.32
> npm ERR! npm -v 1.4.28
> npm ERR! path d:\candy\candy\node_modules\express-scaffold\node_modules\less-mid
> dleware\node_modules\less\node_modules\request\node_modules\http-signature\node_
> modules\ctype\ctio.js
> npm ERR! fstream_path d:\candy\candy\node_modules\express-scaffold\node_modules\
> less-middleware\node_modules\less\node_modules\request\node_modules\http-signatu
> re\node_modules\ctype\ctio.js
> npm ERR! fstream_type File
> npm ERR! fstream_class FileWriter
> npm ERR! code ENOENT
> npm ERR! errno 34
> npm ERR! fstream_stack c:\Program Files\nodejs\node_modules\npm\node_modules\fst
> ream\lib\writer.js:287:26
> npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
> npm ERR! Error: ENOENT, lstat 'd:\candy\candy\node_modules\express-scaffold\node
> _modules\less-middleware\node_modules\less\node_modules\request\node_modules\haw
> k\test\browser.js'
> npm ERR! If you need help, you may report this *entire* log,
> npm ERR! including the npm and node versions, at:
> npm ERR! <http://github.com/npm/npm/issues>
>
> npm ERR! System Windows_NT 6.2.9200
> npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
> s\\node_modules\\npm\\bin\\npm-cli.js" "install" "-d"
> npm ERR! cwd d:\candy\candy
> npm ERR! node -v v0.10.32
> npm ERR! npm -v 1.4.28
> npm ERR! path d:\candy\candy\node_modules\express-scaffold\node_modules\less-mid
> dleware\node_modules\less\node_modules\request\node_modules\hawk\test\browser.js
>
> npm ERR! fstream_path d:\candy\candy\node_modules\express-scaffold\node_modules\
> less-middleware\node_modules\less\node_modules\request\node_modules\hawk\test\br
> owser.js
> npm ERR! fstream_type File
> npm ERR! fstream_class FileWriter
> npm ERR! code ENOENT
> npm ERR! errno 34
> npm ERR! fstream_stack c:\Program Files\nodejs\node_modules\npm\node_modules\fst
> ream\lib\writer.js:287:26
> npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
> npm http 304 https://registry.npmjs.org/combined-stream
> npm info install async[@0](/user/0).9.0 into d:\candy\candy\node_modules\express-scaffold\n
> ode_modules\less-middleware\node_modules\less\node_modules\request\node_modules\
> form-data
> npm info install combined-stream[@0](/user/0).0.5 into d:\candy\candy\node_modules\express-
> scaffold\node_modules\less-middleware\node_modules\less\node_modules\request\nod
> e_modules\form-data
> npm info installOne async[@0](/user/0).9.0
> npm info installOne combined-stream[@0](/user/0).0.5
> npm info preinstall combined-stream[@0](/user/0).0.5
> npm info trying registry request attempt 1 at 21:16:04
> npm http GET https://registry.npmjs.org/delayed-stream
> npm info preinstall async[@0](/user/0).9.0
> npm info build d:\candy\candy\node_modules\express-scaffold\node_modules\less-mi
> ddleware\node_modules\less\node_modules\request\node_modules\form-data\node_modu
> les\async
> npm info linkStuff async[@0](/user/0).9.0
> npm info install async[@0](/user/0).9.0
> npm info postinstall async[@0](/user/0).9.0
> npm http 304 https://registry.npmjs.org/delayed-stream
> npm info install delayed-stream[@0](/user/0).0.5 into d:\candy\candy\node_modules\express-s
> caffold\node_modules\less-middleware\node_modules\less\node_modules\request\node
> _modules\form-data\node_modules\combined-stream
> npm info installOne delayed-stream[@0](/user/0).0.5
> npm info preinstall delayed-stream[@0](/user/0).0.5
> npm info build d:\candy\candy\node_modules\express-scaffold\node_modules\less-mi
> ddleware\node_modules\less\node_modules\request\node_modules\form-data\node_modu
> les\combined-stream\node_modules\delayed-stream
> npm info linkStuff delayed-stream[@0](/user/0).0.5
> npm info install delayed-stream[@0](/user/0).0.5
> npm info postinstall delayed-stream[@0](/user/0).0.5
> npm info build d:\candy\candy\node_modules\express-scaffold\node_modules\less-mi
> ddleware\node_modules\less\node_modules\request\node_modules\form-data\node_modu
> les\combined-stream
> npm info linkStuff combined-stream[@0](/user/0).0.5
> npm info install combined-stream[@0](/user/0).0.5
> npm info postinstall combined-stream[@0](/user/0).0.5
> npm info build d:\candy\candy\node_modules\express-scaffold\node_modules\less-mi
> ddleware\node_modules\less\node_modules\request\node_modules\form-data
> npm info linkStuff form-data[@0](/user/0).1.4
> npm info install form-data[@0](/user/0).1.4
> npm info postinstall form-data[@0](/user/0).1.4
> npm ERR!
> npm ERR! Additional logging details can be found in:
> npm ERR! d:\candy\candy\npm-debug.log
> npm ERR! not ok code 0
>
> Administrator[@MARKYUN](/user/MARKYUN) /d/candy/candy (master)
> $