1、在官网http://nodejs.org/选择下载对应系统的安装文件后启动命令行npm,出现
Error: ENOENT, stat ‘C:\Users\duti\AppData\Roaming\npm’错误,
解决办法:在对应文字新建npm文件夹就行,这是最新版node在win7中的错误
2、输入命令出现
npm ERR! install Couldn’t read dependencies
npm ERR! package.json ENOENT, open ‘C:\Users\duti\Desktop\2048\package.json’
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can’t find a package.json file in your current directory.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command “C:\nodejs\\node.exe” “C:\nodejs\node_modules\npm\bin\npm-cli.js” “install”
npm ERR! cwd C:\Users\duti\Desktop\2048
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path C:\Users\duti\Desktop\2048\package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\duti\Desktop\2048\npm-debug.log
npm ERR! not ok code 0
这是因为缺少package.json文件,这时候只要在项目根目录新建一个package.json文件,文件中包含安装的module和版本就行了