mozilla-jetpack / jpm

Jetpack Manager for Node.js
https://www.npmjs.org/package/jpm
Mozilla Public License 2.0
164 stars 75 forks source link

jpm breaks with node 7+ #604

Closed schalkneethling closed 7 years ago

schalkneethling commented 7 years ago

When running jpm with Node 7+, jpm breaks with the following error:

$ jpm --version
module.js:472
    throw err;
    ^

Error: Cannot find module 'internal/fs'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at evalmachine.<anonymous>:18:20
    at Object.<anonymous> (/usr/local/lib/node_modules/jpm/node_modules/graceful-fs/fs.js:11:1)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)

When running against 6.9.4, jpm works but, the following warning is output in the terminal:

(node:36785) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

kumar303 commented 7 years ago

What version of npm did you install it with?

kumar303 commented 7 years ago

In both cases it seems like it could be an npm bug (of which there are many). Try doing this in each Node version:

npm uninstall -g jpm

Upgrade npm, then run:

npm install -g jpm
schalkneethling commented 7 years ago

It works with version 6.9.4 but, anything 7+ throws the error from above. I did do the uninstall and reinstall as well but, with version 7+ it does not work.

yan12125 commented 7 years ago

Most likely wrong installations.

$ node --version && npm --version && jpm --version
v7.4.0
4.0.5
1.2.2

@schalkneethling It would be helpful if you post the log of npm install -g jpm

schalkneethling commented 7 years ago

@yan12125 At this point it is working so, I am going to close this and will reopen with more info should I run into the problem again.

To be honest, it might have something to do with updating node via npm g

I have now switched to nvm and so far, so good. Thanks!

kumar303 commented 7 years ago

@schalkneethling thanks for the bug report! Sorry about the hassle.