Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

npm install doesnt create package.json file and makes a global installation #21176

Open
lukasz21 opened this issue Jul 9, 2018 · 5 comments
Open

Comments

@lukasz21
Copy link

lukasz21 commented Jul 9, 2018

I'm opening this issue because:

  • [x ] npm is producing an incorrect install.
  • [x ] npm is doing something I don't understand.
  • [x ] npm is producing incorrect or undesirable behavior.

What's going wrong?

How it should be:
I use npm install underscore.string command to make a local installation in a folder without a package.json file. In theory this should give the following result:

  • makes a local installation of package and CREATES a package.json file.

What I get:
What I get as a result is this:

  • makes a global installation of package and DOSEN'T CREATE a package.json file.
    I have the same issue with others packages.

How can the CLI team reproduce the problem?

I'm not sure, but: I have the newest version of node.js [8.11.3 LTS] and npm [6.1.0]. And I still get this issue.

supporting information:

  • npm -v prints: 8.11.3
  • node -v prints: 6.1.0
  • npm config get registry prints: https://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: Windows 7 HP
@DanielRuf
Copy link

What does npm config get output?

@lukasz21
Copy link
Author

lukasz21 commented Jul 9, 2018

npm config get shows:

; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.1.0 node/v8.11.3 win32 x64"

; builtin config undefined
prefix = "C:\\Users\\Admin\\AppData\\Roaming\\npm"

; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\Users\Admin
; HOME = C:\Users\Admin
; "npm config ls -l" to show all defaults.

@DanielRuf
Copy link

Ok. Did you already try a clean reinstall of node and npm?

@lukasz21
Copy link
Author

lukasz21 commented Jul 9, 2018

No, I will give it a try. But I will write about results later, because I'm finishing computer work for today.

@lukasz21
Copy link
Author

Hi, so I tried to reinstall node and npm. It didn't change anything.
The same problem occurs.
'npm config get' command shows the same as before.

Don't know if it's important, but:
The problem occurs only when I try to make a local installation to a a folder without a package.json file.
If I create in this folder package.json file, before I began to install locally a package, then the local installation works. Then the package is only in the folder.

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

No branches or pull requests

2 participants