node.js - 安装 NODE JS 时出现此错误

标签 node.js linux linux-mint

我正在尝试通过这个安装

sudo npm install

遇到这个错误

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/opt/mean/node_modules/node-sass/build'
gyp ERR! System Linux 4.8.0-53-generic
gyp ERR! command "/usr/bin/node" "/opt/mean/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /opt/mean/node_modules/node-sass
gyp ERR! node -v v9.3.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Build failed with error code: 1
npm WARN eslint-config-airbnb@6.0.2 requires a peer of eslint@^2.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb@6.0.2 requires a peer of eslint-plugin-react@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.5.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.5.3 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ranjit/.npm/_logs/2018-01-12T07_23_24_314Z-debug.lo

我也更改了权限。但对我不起作用。

来源 - https://www.digitalocean.com/community/tutorials/how-to-install-a-mean-js-stack-on-an-ubuntu-14-04-server

最佳答案

首先尝试使用此命令以 root 用户身份登录 sudo -i

关于node.js - 安装 NODE JS 时出现此错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48221496/

相关文章:

c++ - 代码::Blocks, and C++ Compiler problem. cant compile a header

javascript - Yeoman 递归提示,回调不运行

javascript - res.send() 在 Node js中功能代码执行之前执行

c - 在 Linux 上使用共享库来减少内存负载

linux - 在 R 中安装与 stringr 包相关的包时出错

linux - Erlang App 不做项目

javascript - 每次刷新页面时都会加载内容

templates - 更新服务器端渲染客户端

java - Tomcat 6中的Webapp启动后找不到环境变量

python - 从 python 脚本设置 bash 变量