npm报错Error: ENOENT, stat 'D:\NodeLearn\node-global'

时间:2022-05-06 00:14:58

最近想试下当前的当红炸子鸡 Nodejs,在安装配置时,发生了下面的错误:

C:\nodejs\npmjs\bin>cd ..

C:\nodejs\npmjs>cd ..

C:\nodejs>npm -v
1.4.28

C:\nodejs>npm config set prefix "D:\NodeLearn\node-global"

C:\nodejs>npm config set cache "D:\NodeLearn\node-cache"
Error: ENOENT, stat 'D:\NodeLearn\node-global'

 原因是没有手动建立文件夹: node-global 和 node-cache,收到建立文件夹之后,就不报错了。

C:\nodejs>npm config set cache "D:\NodeLearn\node-cache"

C:\nodejs>npm config set prefix "D:\NodeLearn\node-global"

 然后将 D:\NodeLearn\node-global, C:\nodejs\node_modules 加入系统 path.

 

安装express:

C:\nodejs>npm install express
express@4.10.7 node_modules\express
├── methods@1.1.1
├── fresh@0.2.4
├── utils-merge@1.0.0
├── merge-descriptors@0.0.2
├── range-parser@1.0.2
├── cookie-signature@1.0.5
├── cookie@0.1.2
├── escape-html@1.0.1
├── finalhandler@0.3.3
├── media-typer@0.3.0
├── vary@1.0.0
├── parseurl@1.3.0
├── serve-static@1.7.2
├── content-disposition@0.5.0
├── path-to-regexp@0.1.3
├── depd@1.0.0
├── qs@2.3.3
├── debug@2.1.1 (ms@0.6.2)
├── on-finished@2.2.0 (ee-first@1.1.0)
├── etag@1.5.1 (crc@3.2.1)
├── send@0.10.1 (ms@0.6.2, destroy@1.0.3, mime@1.2.11, on-finished@2.1.1)
├── accepts@1.1.4 (negotiator@0.4.9, mime-types@2.0.7)
├── type-is@1.5.5 (mime-types@2.0.7)
└── proxy-addr@1.0.4 (forwarded@0.1.0, ipaddr.js@0.1.5)

C:\nodejs>

 

安装百度fis:

C:\nodejs>npm install -g fis
npm ERR! git clone https://github.com/pipobscure/fsevents undefined
npm ERR! git clone https://github.com/pipobscure/fsevents undefined
npm WARN optional dep failed, continuing fsevents@git+https://github.com/pipobscure/fsevents#7dcdf9fa3f8956610fd6f69f72c67bace2de7138
npm WARN optional dep failed, continuing fsevents@0.3.1
D:\NodeLearn\node-global\fis -> D:\NodeLearn\node-global\node_modules\fis\bin\fis
fis@1.8.13 D:\NodeLearn\node-global\node_modules\fis
├── fis-postprocessor-jswrapper@0.0.8
├── fis-command-install@0.0.7
├── fis-packager-map@0.0.9
├── fis-deploy-default@0.0.2
├── colors@0.6.2
├── commander@1.3.2 (keypress@0.1.0)
├── fis-optimizer-clean-css@0.0.9 (clean-css@1.1.7)
├── fis-optimizer-uglify-js@0.1.6 (uglify-js@2.4.15)
├── fis-command-release@0.11.3 (async@0.9.0, chokidar@0.8.4, livereload-server-spec@0.2.3)
├── fis-command-server@0.7.1 (step@0.0.5, chokidar@0.10.5)
├── fis-kernel@2.0.12 (iconv-lite@0.2.10, tar@0.1.17)
├── fis-spriter-csssprites@0.2.5 (node-images@1.5.5)
└── fis-optimizer-png-compressor@0.0.6 (node-pngquant-native@0.0.11, node-pngcrush@0.1.1)

安装报了一个错,但是最终好像还是成功了^_^?