alsotang / node-lessons

:closed_book:《Node.js 包教不包会》 by alsotang
16.54k stars 4.7k forks source link

Error: Cache dir is required #102

Open santong opened 8 years ago

santong commented 8 years ago

新手请教下使用npm命令的时候出现这个错误怎么解决 google了一下没有找到答案,具体报错信息

Error: Cache dir is required at CachingRegistryClient.RegClient (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/index.js:50:33) at new CachingRegistryClient (/usr/local/lib/node_modules/npm/lib/cache/caching-client.js:20:18) at /usr/local/lib/node_modules/npm/lib/npm.js:362:22 at /usr/local/lib/node_modules/npm/lib/config/core.js:82:7 at Array.forEach (native) at /usr/local/lib/node_modules/npm/lib/config/core.js:81:13 at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:16:25) at finalize (/usr/local/lib/node_modules/npm/lib/config/core.js:200:5) at Conf.afterCARead (/usr/local/lib/node_modules/npm/lib/config/load-cafile.js:15:40) at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:76:16 npm ERR! Darwin 15.5.0 npm ERR! argv "node" "/usr/local/bin/npm" npm ERR! node v0.10.36 npm ERR! npm v1.3.14

steve-wanglin commented 8 years ago

请附上你的npm 命令

santong commented 8 years ago

@steve-wanglin 现在解决了,我是使用curl -L https://www.npmjs.org/install.sh | sh重新安装后解决了。

但是之前使用任何命令都会出现上面的错误,比如: npm init, npm cache clean等等都会报上面的错误,不知道是为什么

xiaojiandong commented 8 years ago

请问,如何用gulp把requirejs里面所有的js,压缩打包成一个js?