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

[BUG] NPM Stopped working when updated. #2850

Closed
ImSpeddy opened this issue Mar 10, 2021 · 7 comments
Closed

[BUG] NPM Stopped working when updated. #2850

ImSpeddy opened this issue Mar 10, 2021 · 7 comments
Labels
Bug thing that needs fixing platform:windows is Windows-specific Release 7.x work is associated with a specific npm 7 release

Comments

@ImSpeddy
Copy link

I updated npm some days ago to 7.6.1 and npm stopped working. I opened a StackOverflow Thread for help (https://stackoverflow.com/questions/66533246/why-did-npm-stopped-working-after-an-update) but I couldn't do nothing

I've tried to reinstall node but it didn't helped me.
Every npm command gives me the same error.

Here is an example of what happens.

C:\Users\ethan>npm
internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'code-point-at'
Require stack:
- C:\Users\ethan\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\node_modules\string-width\index.js
- C:\Users\ethan\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\wide-truncate.js
- C:\Users\ethan\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\render-template.js
- C:\Users\ethan\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\plumbing.js
- C:\Users\ethan\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\index.js
- C:\Users\ethan\AppData\Roaming\npm\node_modules\npm\node_modules\npmlog\log.js
- C:\Users\ethan\AppData\Roaming\npm\node_modules\npm\lib\cli.js
- C:\Users\ethan\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Users\ethan\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\node_modules\string-width\index.js:3:19)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\ethan\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\node_modules\\string-width\\index.js',
    'C:\\Users\\ethan\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\wide-truncate.js',
    'C:\\Users\\ethan\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\render-template.js',
    'C:\\Users\\ethan\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\plumbing.js',
    'C:\\Users\\ethan\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\index.js',
    'C:\\Users\\ethan\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\npmlog\\log.js',
    'C:\\Users\\ethan\\AppData\\Roaming\\npm\\node_modules\\npm\\lib\\cli.js',
    'C:\\Users\\ethan\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js'
  ]
}

My enviroment is:
Windows 10 20H2
Node: 14.16.0
npm: 7.6.1

@darcyclarke
Copy link
Contributor

@TheSpeddyEthanYT can you try replicating this problem on the latest version of npm? (ie. npm i -g npm)

@bl-ue
Copy link

bl-ue commented Jun 8, 2021

@hamzajaffar and @armelangton — please work with Darcy to investigate the issue (nodejs/node#38317).

@ssr-02kk
Copy link

  1. Type this in cmd or terminal:
    npm install -g expo-cli --force
  2. Now type the command again for installing truffle:
    npm install truffle -g
    WORKED FOR ME :)

https://stackoverflow.com/questions/58949120/error-cannot-find-module-c-users-senyo-appdata-roaming-npm-node-modules-expo
Got help from here ^

@marekhalmo
Copy link

Tried the solution of @ssr-02kk - still the same result

node:internal/modules/cjs/loader:933
const err = new Error(message);
^

Error: Cannot find module 'code-point-at'
Require stack:

  • C:\Program Files\nodejs\node_modules\npm\node_modules\wide-align\node_modules\string-width\index.js
  • C:\Program Files\nodejs\node_modules\npm\node_modules\wide-align\align.js
  • C:\Program Files\nodejs\node_modules\npm\node_modules\gauge\lib\render-template.js
  • C:\Program Files\nodejs\node_modules\npm\node_modules\gauge\lib\plumbing.js
  • C:\Program Files\nodejs\node_modules\npm\node_modules\gauge\lib\index.js
  • C:\Program Files\nodejs\node_modules\npm\node_modules\npmlog\lib\log.js
  • C:\Program Files\nodejs\node_modules\npm\lib\utils\log-shim.js
  • C:\Program Files\nodejs\node_modules\npm\lib\utils\exit-handler.js

@MEZ901
Copy link

MEZ901 commented Jan 10, 2023

for me, the node_modules file was missing. check if it is there. To solve the problem I simply went to the control panel->uninstall apps->nodejs(right-click on nodejs)-> select repair. My node_modules file was back.

https://stackoverflow.com/questions/58949120/error-cannot-find-module-c-users-senyo-appdata-roaming-npm-node-modules-expo
Got help from here

@ImSpeddy
Copy link
Author

ImSpeddy commented Feb 1, 2023

What I did was installing the missing module by downloading it from other source (Windows Ubuntu CLI on my case) and pasting it onto the packages folder.

@jrkarnes
Copy link

jrkarnes commented Feb 15, 2023

FWIW, I ran into this issue while attempting to execute the setup-node action with the following syntax:

 - name: Setup Node @ 16
   uses: actions/setup-node@v3
   with:
        node-version: 16
        token: ${{ secrets.GH_GITHUB_COM_TOKEN }}

which produced the following error:

Warning: node:internal/modules/cjs/loader:995
    const err = new Error(message);
                ^
  
  Error: Cannot find module './ranges/to-comparators'
  Require stack:
  - /opt/hostedtoolcache/node/16.19.0/x64/lib/node_modules/npm/node_modules/semver/index.js
  - /opt/hostedtoolcache/node/16.19.0/x64/lib/node_modules/npm/lib/cli.js
  - /opt/hostedtoolcache/node/16.19.0/x64/lib/node_modules/npm/bin/npm-cli.js
      at Function.Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
      at Function.Module._load (node:internal/modules/cjs/loader:841:27)
      at Module.require (node:internal/modules/cjs/loader:1067:19)
      at require (node:internal/modules/cjs/helpers:103:18)
      at Object.<anonymous> (/opt/hostedtoolcache/node/16.19.0/x64/lib/node_modules/npm/node_modules/semver/index.js:37:18)
      at Module._compile (node:internal/modules/cjs/loader:1165:14)
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
      at Module.load (node:internal/modules/cjs/loader:1043:32)
      at Function.Module._load (node:internal/modules/cjs/loader:878:12)
      at Module.require (node:internal/modules/cjs/loader:1067:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/opt/hostedtoolcache/node/16.19.0/x64/lib/node_modules/npm/node_modules/semver/index.js',
      '/opt/hostedtoolcache/node/16.19.0/x64/lib/node_modules/npm/lib/cli.js',
      '/opt/hostedtoolcache/node/16.19.0/x64/lib/node_modules/npm/bin/npm-cli.js'
    ]
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing platform:windows is Windows-specific Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

7 participants