-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Bugthing that needs fixingthing that needs fixingPriority 2secondary priority issuesecondary priority issueRelease 9.xwork is associated with a specific npm 9 releasework is associated with a specific npm 9 release
Description
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
mkdir project && cd project
echo "{\"name\": \"project\"}" > package.json
npm install --prefix="$PWD"
On macOS, this does the expected thing (generates a package-lock.json:
{
"name": "project",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "project"
}
}
}On Windows, however, it does strange things. It:
- Adds
{ "dependencies": { "project": "file:" }}topackage.json - Generates a package-lock:
{ "name": "project", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "project", "dependencies": { "project": "file:" } }, "node_modules/project": { "resolved": "", "link": true } } } - Generaetes node_modules directory with a symlink
projectpointing to PWD
Expected Behavior
I expect Windows to have the same behavior. Particularly, package.json should not be modified.
Steps To Reproduce
See above
Environment
- npm: 9.5.1
- Node.js: v18.16.0
- OS Name: Windows 10
- System Model Name:
- npm config:
; copy and paste output from `npm config ls` here
; "builtin" config from C:\Program Files\nodejs\node_modules\npm\npmrc
prefix = "C:\\Users\\mehulkar\\AppData\\Roaming\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; node version = v18.16.0
; npm local prefix = C:\Users\mehulkar\project
; npm version = 9.5.1
; cwd = C:\Users\mehulkar\project
; HOME = C:\Users\mehulkar
; Run `npm config ls -l` to show all defaults.
tlaurie-cl
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingPriority 2secondary priority issuesecondary priority issueRelease 9.xwork is associated with a specific npm 9 releasework is associated with a specific npm 9 release