NPM can't install appjs. Error: Cannot find mo

2019-01-25 08:56发布

I installed node.js and npm already, but when I try to install appjs I get this error:

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.

I am using Ubuntu 12.04 LTS.

P.S.: Here's the link to the appjs website: http://appjs.org/

4条回答
ら.Afraid
2楼-- · 2019-01-25 09:36

I had this problem when trying to install anything with npm on a Ubuntu LTS12.04 vps, and I solved it with

sudo apt-get remove npm
sudo apt-get install npm

You may also want to run npm install __ inside of /usr/lib/nodejs

查看更多
The star\"
3楼-- · 2019-01-25 09:41

I also had the graceful-fs problem. After seeing this message when trying to update 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. I was able to install graceful-fs, request, and other modules after that. Probably not the best solution, but none of the other solutions here worked for me.

查看更多
何必那么认真
4楼-- · 2019-01-25 09:47

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
查看更多
手持菜刀,她持情操
5楼-- · 2019-01-25 09:49

With the node.js PPA from Chris Lea, npm is integrated in the nodejs package since version 0.10. Works with 12.04 LTS.

查看更多
登录 后发表回答