gpt4 book ai didi

node.js - 在 Linux 机器上安装 npm 时出错

转载 作者:太空宇宙 更新时间:2023-11-04 04:58:24 25 4
gpt4 key购买 nike

大家好,我在安装 MEANStack-Server 时遇到问题......

只需在 digitalocean 上设置一台新的 Linux 机器并继续安装堆栈。在/opt/mean 中安装 npm 期间,一切都开始变得不正常。

安装就这样被终止了:

/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 start 无论如何都会出现:

/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

关于node.js - 在 Linux 机器上安装 npm 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40196140/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com