我在Ubuntu服务器上载了我的网站,它包含package.json
。
现在我想在我的网站目录中使用npm install
安装所有依赖项。
我的网站不在根文件夹中。节点和NPM已经安装在我的服务器上。
以下是我运行npm install
时出现的错误:
npm ERR! makeCacheDir homeless?
npm ERR! Error: ENOENT, stat '/root'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 3.16.0-30-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /opt/mywebsite
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /root
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! makeCacheDir homeless?
npm ERR! makeCacheDir homeless?
npm ERR! makeCacheDir homeless?
npm ERR! makeCacheDir homeless?
npm ERR! makeCacheDir homeless?
npm ERR! makeCacheDir homeless?
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /opt/mywebsite/npm-debug.log
npm ERR! not ok code 0
答案 0 :(得分:0)
我相信,你需要root帐户。尝试使用sudo
运行。
sudo npm install