ubuntu 安装nodejs的插件 pm2 一直出现这种问题
jacky[@ubuntu](/user/ubuntu):~$ sudo npm install -g pm2 --nodedir=/usr/bin/node
npm http GET https://registry.npmjs.org/pm2
npm http 304 https://registry.npmjs.org/pm2
npm http GET https://registry.npmjs.org/pm2-multimeter/0.1.2
npm http GET https://registry.npmjs.org/commander/2.1.0
npm http GET https://registry.npmjs.org/cli-table/0.2.0
npm http GET https://registry.npmjs.org/pm2-interface/0.1.0
npm http GET https://registry.npmjs.org/usage/0.3.9
npm http GET https://registry.npmjs.org/axon-rpc/0.0.2
npm http GET https://registry.npmjs.org/watch/0.8.0
npm http GET https://registry.npmjs.org/axon/1.0.0
npm http GET https://registry.npmjs.org/cron/1.0.1
npm http GET https://registry.npmjs.org/colors/0.6.2
npm http GET https://registry.npmjs.org/coffee-script/1.7.0
npm http GET https://registry.npmjs.org/eventemitter2/0.4.13
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/async/0.2.9
npm http 304 https://registry.npmjs.org/commander/2.1.0
npm http 304 https://registry.npmjs.org/pm2-multimeter/0.1.2
npm http 304 https://registry.npmjs.org/pm2-interface/0.1.0
npm http 304 https://registry.npmjs.org/cli-table/0.2.0
npm http 304 https://registry.npmjs.org/axon-rpc/0.0.2
npm http 304 https://registry.npmjs.org/watch/0.8.0
npm http 304 https://registry.npmjs.org/axon/1.0.0
npm http 304 https://registry.npmjs.org/usage/0.3.9
npm http 304 https://registry.npmjs.org/cron/1.0.1
npm http 304 https://registry.npmjs.org/colors/0.6.2
npm http 304 https://registry.npmjs.org/coffee-script/1.7.0
npm http 304 https://registry.npmjs.org/eventemitter2/0.4.13
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/async/0.2.9
npm http GET https://registry.npmjs.org/commander/1.0.5
npm http GET https://registry.npmjs.org/charm
npm http GET https://registry.npmjs.org/colors/0.3.0
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/configurable/0.0.1
npm http GET https://registry.npmjs.org/escape-regexp/0.0.1
npm http GET https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/commander/1.0.5
npm http GET https://registry.npmjs.org/keypress
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/charm
npm http 304 https://registry.npmjs.org/colors/0.3.0
> usage[@0](/user/0).3.9 install /usr/lib/node_modules/pm2/node_modules/usage
> node-gyp rebuild
gyp: /usr/bin/node/common.gypi not found (cwd: /usr/lib/node_modules/pm2/node_modules/usage) while reading includes of binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.2.0-60-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/pm2/node_modules/usage
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm http 304 https://registry.npmjs.org/escape-regexp/0.0.1
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/configurable/0.0.1
npm ERR! Error: ENOENT, chown '/usr/lib/node_modules/pm2/node_modules/coffee-script/node_modules/mkdirp/readme.markdown'
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 Linux 3.2.0-60-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "pm2" "--nodedir=/usr/bin/node"
npm ERR! cwd /home/jacky
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /usr/lib/node_modules/pm2/node_modules/coffee-script/node_modules/mkdirp/readme.markdown
npm ERR! fstream_path /usr/lib/node_modules/pm2/node_modules/coffee-script/node_modules/mkdirp/readme.markdown
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chown
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:133:7
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http 304 https://registry.npmjs.org/keypress
npm ERR! usage[@0](/user/0).3.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the usage[@0](/user/0).3.9 install script.
npm ERR! This is most likely a problem with the usage package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls usage
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.2.0-60-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "pm2" "--nodedir=/usr/bin/node"
npm ERR! cwd /home/jacky
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/jacky/npm-debug.log
npm ERR! not ok code 0
1 回复
Error: ENOENT, chown ‘/usr/lib/node_modules/pm2/node_modules/coffee-script/node_modules/mkdirp/readme.markdown’ 权限