-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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] (windows) npm@8.3.1 --prefix or --cwd not working with 'install', WARN Ignoring workspaces for specified package(s) #4511
Comments
This --prefix worked back in NPM 8.1.2 in Windows and Linux |
i'm not following what's happening here.. i would note that can you tell us more about your directory structure and what you're trying to do? are you using workspaces? |
Hi nlf,
my workaround is this: |
i was able to reproduce this following these steps, please let me know if i missed anything: > mkdir repo_root
> cd repo_root
> git init
> mkdir project
> cd project
> npm init -y
# installing a dependency in the project just so we can see it's doing something
> npm i debug
> cd ..
> npm --prefix ./project install
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\username\Projects\temp\root/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\username\Projects\temp\root\package.json'
npm ERR! enoent This is related to npm not being able to find a file. which sure makes it look as though we're disregarding the |
Yes! thats right! |
Hello, what workaround did you use for this issue? I'm facing something similar right now |
Still not working :( |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
`
D:\git_projects\arcadia>npm --prefix "%PWD%%PROJECT%" --cwd "%PWD%%PROJECT%" run dev
npm WARN Ignoring workspaces for specified package(s)
D:\git_projects\arcadia>npm --cwd "%PWD%%PROJECT%" install
npm WARN Ignoring workspaces for specified package(s)
D:\git_projects\arcadia>npm --prefix "%PWD%%PROJECT%" install
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\git_projects\arcadia/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\git_projects\arcadia\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\😊\AppData\Local\npm-cache_logs\2022-03-02T19_34_03_309Z-debug-0.log
D:\git_projects\arcadia>npm --cwd "%PWD%%PROJECT%" install --loglevel verbose
npm verb cli [
npm verb cli 'C:\Program Files\nodejs\node.exe',
npm verb cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
npm verb cli '--cwd',
npm verb cli 'D:\git_projects\arcadia\arcadia',
npm verb cli 'install',
npm verb cli '--loglevel',
npm verb cli 'verbose'
npm verb cli ]
npm info using npm@8.3.1
npm info using node@v16.14.0
npm timing npm:load:whichnode Completed in 1ms
npm timing config:load:defaults Completed in 4ms
npm timing config:load:file:D:\m_portable\nodejs\APP_PORTABLE\node_modules\npm\npmrc Completed in 7ms
npm timing config:load:builtin Completed in 8ms
npm timing config:load:cli Completed in 8ms
npm timing config:load:env Completed in 1ms
npm timing config:load:file:D:\git_projects\arcadia.npmrc Completed in 0ms
npm timing config:load:project Completed in 8ms
npm timing config:load:file:C:\Users\😊.npmrc Completed in 0ms
npm timing config:load:user Completed in 1ms
npm timing config:load:file:C:\Users\😊\AppData\Roaming\npm\etc\npmrc Completed in 0ms
npm timing config:load:global Completed in 1ms
npm timing config:load:validate Completed in 0ms
npm timing config:load:credentials Completed in 3ms
npm timing config:load:setEnvs Completed in 2ms
npm timing config:load Completed in 37ms
npm timing npm:load:configload Completed in 39ms
npm timing npm:load:setTitle Completed in 1ms
npm timing config:load:flatten Completed in 8ms
npm timing npm:load:display Completed in 67ms
npm verb logfile C:\Users\😊\AppData\Local\npm-cache_logs\2022-03-02T19_42_49_495Z-debug-0.log
npm timing npm:load:logFile Completed in 40ms
npm timing npm:load:timers Completed in 0ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load Completed in 157ms
npm WARN Ignoring workspaces for specified package(s)
npm timing command:info Completed in 129ms
npm verb exit 0
npm timing npm Completed in 885ms
npm info ok`
Expected Behavior
`
D:\git_projects\arcadia>cd arcadia
D:\git_projects\arcadia\arcadia>npm install --loglevel verbose
npm verb cli [
npm verb cli 'C:\Program Files\nodejs\node.exe',
npm verb cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
npm verb cli 'install',
npm verb cli '--loglevel',
npm verb cli 'verbose'
npm verb cli ]
npm info using npm@8.3.1
npm info using node@v16.14.0
npm timing npm:load:whichnode Completed in 2ms
npm timing config:load:defaults Completed in 4ms
npm timing config:load:file:D:\m_portable\nodejs\APP_PORTABLE\node_modules\npm\npmrc Completed in 8ms
npm timing config:load:builtin Completed in 8ms
npm timing config:load:cli Completed in 8ms
npm timing config:load:env Completed in 2ms
npm timing config:load:file:D:\git_projects\arcadia\arcadia.npmrc Completed in 6ms
npm timing config:load:project Completed in 9ms
npm timing config:load:file:C:\Users\😊.npmrc Completed in 0ms
npm timing config:load:user Completed in 1ms
npm timing config:load:file:C:\Users\😊\AppData\Roaming\npm\etc\npmrc Completed in 0ms
npm timing config:load:global Completed in 1ms
npm timing config:load:validate Completed in 1ms
npm timing config:load:credentials Completed in 3ms
npm timing config:load:setEnvs Completed in 4ms
npm timing config:load Completed in 42ms
npm timing npm:load:configload Completed in 43ms
npm timing npm:load:setTitle Completed in 1ms
npm timing config:load:flatten Completed in 12ms
npm timing npm:load:display Completed in 83ms
npm verb logfile C:\Users\😊\AppData\Local\npm-cache_logs\2022-03-02T19_46_58_104Z-debug-0.log
npm timing npm:load:logFile Completed in 60ms
npm timing npm:load:timers Completed in 0ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load Completed in 203ms
npm timing arborist:ctor Completed in 3ms
npm timing arborist:ctor Completed in 0ms
npm timing idealTree:init Completed in 51ms
npm timing idealTree:userRequests Completed in 1ms
npm http fetch GET 200 https://registry.npmjs.org/@next-auth%2fmongodb-adapter 2460ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/mongodb 229ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/next-auth 189ms (cache miss)
`
Steps To Reproduce
Windows 11 64 bits latest
nodejs = v16.14.0 // npm = 8.3.1
npm --cwd or --prefix install or run dev, anything will not make npm process files on subfolder, only when entering package.json folder
npm WARN Ignoring workspaces for specified package(s)
Environment
The text was updated successfully, but these errors were encountered: