在Linux机器上安装npm时出错



嘿,伙计们,我有一个问题安装我的MEANStack-Server....

刚刚在digitalocean上安装了一台新的linux机器,然后继续安装堆栈。在npm安装/opt/的过程中,意味着所有的东西都开始出线了。

Install被这样杀死:

/opt/mean$ sudo npm install
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
Killed         ....] / extract:socket.io: sill doParallel extract 833
even minimatch 3.0.2 is installed:
/opt/mean$ npm -v minimatch
3.10.9

无论如何执行NPM启动:

/opt/mean$ npm start
> meanjs@0.5.0 start /opt/mean
> gulp
module.js:327
    throw err;
    ^
Error: Cannot find module 'process-nextick-args'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/opt/mean/node_modules/gulp-util/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js:21:23)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
npm ERR! Linux 4.4.0-45-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.6.1
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! meanjs@0.5.0 start: `gulp`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the meanjs@0.5.0 start script 'gulp'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the meanjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs meanjs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls meanjs
npm ERR! There is likely additional logging output above.
npm ERR! Linux 4.4.0-45-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.6.1
npm ERR! npm  v3.10.9
npm ERR! path npm-debug.log.2338324848
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.2338324848'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES: permission denied, open 'npm-debug.log.2338324848']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'open',
npm ERR!   path: 'npm-debug.log.2338324848' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR!     /opt/mean/npm-debug.log

你们中有谁知道什么是错的,或者如何继续找到真正的错误?

最好的费边

我在NPM升级后遇到了这个问题。我设法解决了这个问题:

sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

来源:https://docs.npmjs.com/getting-started/fixing-npm-permissions

我遇到过这样的错误。试试这个:npm update然后npm install npm -g

最新更新