node.js - 使用 npm 安装 gulp

标签 node.js npm digital-ocean

我正在尝试使用以下命令(使用和不使用 sudo)通过 npm 在 DigitalOcean droplet 上安装 gulp:

npm install -g gulp

我遇到了我无法弄清楚的错误:

> v8flags@1.0.5 install /root/local/lib/node_modules/gulp/node_modules/v8flags
> node fetch.js

sh: 1: node: Permission denied
npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "node" "/root/local/bin/npm" "install" "-g" "gulp"
npm ERR! node v0.10.33
npm ERR! npm  v2.1.11
npm ERR! code ELIFECYCLE

npm ERR! v8flags@1.0.5 install: `node fetch.js`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the v8flags@1.0.5 install script 'node fetch.js'.
npm ERR! This is most likely a problem with the v8flags package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node fetch.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls v8flags
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/local/bin/npm-debug.log

Node 安装是根据this进行的指导。

最佳答案

我有同样的问题,安装早期版本的 gulp 对我有用:

sudo npm install -g gulp@3.8.8

在这里找到:http://forum.ionicframework.com/t/osx-error-v8flags-after-npm-update-ionic/13905/5

还尝试了许多其他解决方案,涉及此处提到的解决方案: NPM cannot install dependencies - Attempt to unlock something which hasn't been locked

这些都不适合我。

我得到的错误是这样的:

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
/
node.js:815
    var cwd = process.cwd();
                      ^
Error: EACCES, permission denied
    at Function.startup.resolveArgv0 (node.js:815:23)
    at startup (node.js:58:13)
    at node.js:906:3

关于node.js - 使用 npm 安装 gulp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27344451/

相关文章:

node.js - Node http 服务器无法在 Ubuntu Linux 上运行

digital-ocean - Terraform 和 DigitalOcean : assign volume to specific droplet created with count parameter

javascript - 如何在 Sails.js 的所有页面中监听登录用户的套接字更新?

node.js - 通过多次调用计算异步函数的执行时间

node.js - 如何在子域上运行 socket.io?

node.js - Mongoose throwing 在使用变量代替显式字符串时,必须指定字段错误

meteor - 在 Meteor 中安装和使用 bower 的正确方法是什么?

node.js - 在 Windows 7 中安装 sails 时出错

ssh - 通过 Codeship 部署到 Digital Ocean 时出现 v8-compile-cache-0 目录

ruby-on-rails - `secret_key_base` 环境缺少 'production',请在 Ubuntu 服务器上的 config/secrets.yml 中设置此值