[英]NPM can't install appjs. Error: Cannot find module 'graceful-fs'
I installed node.js and npm already, but when I try to install appjs I get this error: 我已经安装了node.js和npm,但是当我尝试安装appjs时出现此错误:
zephlon@zephlon-T5254:~$ npm install appjs
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'graceful-fs'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object.<anonymous> (/usr/share/npm/lib/utils/ini.js:32:10)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
I get similar errors on any attempt to install graceful-fs
. 我试图安装
graceful-fs
遇到类似的错误。
I am using Ubuntu 12.04 LTS. 我使用的是Ubuntu 12.04 LTS。
PS: Here's the link to the appjs website: http://appjs.org/ PS:这是appjs网站的链接: http ://appjs.org/
use the following script to solve this 使用以下脚本来解决此问题
git clone git://github.com/isaacs/npm.git
cd npm/scripts
chmod +x install.sh
sudo ./install.sh
I had this problem when trying to install anything with npm on a Ubuntu LTS12.04 vps, and I solved it with 尝试在Ubuntu LTS12.04 vps上安装任何带有npm的东西时遇到了这个问题,我解决了这个问题
sudo apt-get remove npm
sudo apt-get install npm
You may also want to run npm install _ _ inside of /usr/lib/nodejs 您可能还想在/ usr / lib / nodejs中运行npm install _ _
With the node.js PPA from Chris Lea, npm
is integrated in the nodejs
package since version 0.10 . 使用Chris Lea的node.js PPA,从版本0.10开始 ,
npm
集成在nodejs
包中。 Works with 12.04 LTS. 适用于12.04 LTS。
I also had the graceful-fs problem. 我也有优雅的问题。 After seeing this message when trying to update npm:
在尝试更新npm时看到此消息后:
Error: npm doesn't work with node v0.10.0
Required: node@0.6 || 0.7 || 0.8
I used the n module to switch to 0.8.22 stable release of node. 我用n模块切换到0.8.22稳定释放节点。 I was able to install graceful-fs, request, and other modules after that.
之后我能够安装graceful-fs,request和其他模块。 Probably not the best solution, but none of the other solutions here worked for me.
可能不是最好的解决方案,但这里没有其他解决方案适用于我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.