Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm ERR! code MODULE_NOT_FOUND in node 7 and 8 after installing 4.1.2 #453

Closed
tommilimmot opened this issue Jul 30, 2017 · 3 comments
Closed

Comments

@tommilimmot
Copy link

tommilimmot commented Jul 30, 2017

Issue Template:

Describe issue including what OS you are using

macOS Sierra 10.12.5

Describe what version of N you have

n --version 2.1.7 (via Homebrew)

Describe how you installed N

brew install n

Steps to reproduce issue 1.2.3

Fresh installation, no node/npm installed previously

  1. n stable
    install : node-v8.2.1
    mkdir : /usr/local/n/versions/node/8.2.1
    fetch : https://nodejs.org/dist/v8.2.1/node-v8.2.1-darwin-x64.tar.gz
    node -v v8.2.1
    npm -v 5.3.0
    npm doctor
    Check Value Recommendation
    npm ping OK
    npm -v v5.3.0
    node -v v8.2.1
    npm config get registry https://registry.npmjs.org/
    which git /usr/local/bin/git
    Perms check on cached files ok
    Perms check on global node_modules ok
    Perms check on local node_modules ok
    Verify cache contents verified 969 tarballs
  2. n 4.1.2
    install : node-v4.1.2
    mkdir : /usr/local/n/versions/node/4.1.2
    fetch : https://nodejs.org/dist/v4.1.2/node-v4.1.2-darwin-x64.tar.gz
    node -v v4.1.2
    npm -v 2.14.4
  3. n 8.2.1
    npm doctor
    npm ERR! code MODULE_NOT_FOUND
    npm ERR! Cannot find module 'internal/fs'
    npm ERR! A complete log of this run can be found in:
    npm ERR! /Users/name/.npm/_logs/2017-07-30T01_22_21_881Z-debug.log

Describe the results you received

npm list -g --depth=0
/usr/local/lib
└── npm@5.3.0

npm ERR! missing: npm-package-arg@^4.0.0, required by realize-package-specifier@3.0.1
npm ERR! invalid: graceful-fs@3.0.8 /usr/local/lib/node_modules/npm/node_modules/cmd-shim/node_modules/graceful-fs
npm ERR! invalid: glob@4.5.3 /usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/glob
npm ERR! invalid: tar@1.0.3 /usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/tar
npm ERR! invalid: graceful-fs@3.0.8 /usr/local/lib/node_modules/npm/node_modules/npm-registry-client/node_modules/graceful-fs
npm ERR! invalid: readable-stream@2.0.2 /usr/local/lib/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream
npm ERR! invalid: has-unicode@1.0.0 /usr/local/lib/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode
npm ERR! invalid: graceful-fs@3.0.8 /usr/local/lib/node_modules/npm/node_modules/sha/node_modules/graceful-fs

Describe the results you expected

Working npm@5.3.0

What version of npm you are using

No node/npm installed previously, only through n 8.2.1 and n 4.1.2

Additional information you deem important (e.g. issue happens only occasionally):

Could those invalid packages leftovers from node 4.1.2/npm 2.14.4 ( #403 )? Can't update npm myself.
npm install -g npm@latest
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'internal/fs'

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/name/.npm/_logs/2017-07-30T02_09_56_157Z-debug.log

Probably related to/duplicate of #310.

which n /usr/local/bin/n

(paste your output here)

@leocaseiro
Copy link

Try reinstall npm:

$ curl -0 -L https://npmjs.com/install.sh | sudo sh

You might not need sudo

If doesn't work still, try re-install node.
If you installed node with brew, try:

$ brew uninstall node
$ brew install node

If you still having issues after that, try this solution

@ninapavlich
Copy link

I tried the steps @leocaseiro suggested, but that didn't work for me. Oddly re-installing it from the GUI worked (https://nodejs.org/en/download/) -- which installed version Node v8.11.1, NPM 5.6.0. For reference I'm on OSX 10.12.6.

Just wanted to add this comment in case it helps others resolve this issue!

@shadowspawn
Copy link
Collaborator

This issue was hopefully fixed by #470

This issue has not had any activity in over six months. It isn't likely to get acted on due to this report.

Feel free to open a new issue if it comes up again, with new information and renewed interest.

Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants