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 install not working #5039

Closed
2 tasks done
pitAlex opened this issue Jun 18, 2022 · 5 comments
Closed
2 tasks done

npm install not working #5039

pitAlex opened this issue Jun 18, 2022 · 5 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release

Comments

@pitAlex
Copy link

pitAlex commented Jun 18, 2022

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

npm install is not creating node_modules, not creating package-lock.json, not downloading anything it simply does some checks and then finishes as if everything is fine.

Expected Behavior

should install the project's dependencies.

Steps To Reproduce

After upgrading from node 12 and npm 6 to node 16 and npm 8, npm install stopped working. It just won't install anything and I am forced to use yarn for everything.

Environment

  • npm: 8.12.2
  • Node.js: 16.15.1
  • OS Name: macOS Monterery
  • System Model Name: MacBook Pro
  • npm config:
//registry.npmjs.org/:_authToken = (protected) 
package-lock = true 
package-lock-only = true 
save = false 

; node bin location = /usr/local/bin/node
; node version = v16.15.1
; npm local prefix = /Users/username
; npm version = 8.12.2
; cwd = /Users/username
; HOME = /Users/username
@pitAlex pitAlex added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Jun 18, 2022
@lars-reimann
Copy link

lars-reimann commented Jun 18, 2022

I have the same issue since yesterday evening.

Environment

  • npm (tried multiple): 8.5.0, 8.11.0 and 8.12.2
  • Node.js (tried multiple): v16.14.2, v16.15.1
  • OS Name: Windows 11
  • System Model Name: Dell XPS 15

Other observations

The first time I run npm i on a project, npm outputs added 1 package, and audited 3 packages in 420ms and puts the local project into C:\Users\Lars\AppData\Roaming\npm\node_modules. When I run npm i again afterwards, nothing happens anymore and npm logs up to date, audited 3 packages in 436ms. No node_modules folder is created in the project directory itself.

Running npm i <package_name> downloads the package into C:\Users\Lars\AppData\Roaming\npm\node_modules but still does not create a node_modules folder in the project itself.

@lars-reimann
Copy link

lars-reimann commented Jun 18, 2022

I fixed it: When working around #4989 I somehow manage to write the following into C:\Users\Lars\.npmrc:

ignore-scripts=true
global=true
true=

The global=true caused the behavior I described above. Changing this file back to the following fixed the issue:

ignore-scripts=true

@fritzy
Copy link
Contributor

fritzy commented Jun 29, 2022

@pitAlex npm install will not behave the way you expect it to when package-lock-only is set to true and you don't have a complete package lock. In fact, package-lock-only only updates the package lock, and does not install packages into node_modules.

@fritzy fritzy closed this as completed Jun 29, 2022
@pitAlex
Copy link
Author

pitAlex commented Jun 30, 2022

@fritzy I could swear it wasn't working before I went and edited the .npmrc and added those lines (package-lock=true, package-lock-only=true). Didn't even know it existed until I started having this problem and looked for answers and learned about it. Anyway, after removing them - npm ci worked, as in it created the node_modules, and that's good enough for me. Thanks.

@siddheshsonawane07
Copy link

@pitAlex
not working even after the changes done in .npmrc file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

4 participants