You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.
npx create-react-app test works as expected but npx -p create-react-app -c "create-react-app test" will fail with the following error:
→ npx -p create-react-app -c "create-react-app test"
Command failed: /Users/codonnell/.nvm/versions/node/v12.16.1/bin/node /Users/codonnell/.nvm/versions/node/v12.16.1/lib/node_modules/npx/node_modules/npm/bin/npm-cli.js run env --parseable
npm ERR! path /Users/codonnell/Sites/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/codonnell/Sites/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! /Users/codonnell/.npm/_logs/2020-04-12T16_16_14_116Z-debug.log
This is a contrived example to display the issue. The real issue arose for me when attempting to run a yeoman generator, which requires 2 dependencies, hence the need to run with -p.
When I run the same command in directory with a package.json it works as expected. It does NOT mutate the package.json and doesn't install any modules in that directory, which is to be expected. However it's still failing unless you actually have a package.json file in the cwd
Steps to Reproduce
Run npx with -p & -c options to run a cli instead of just running directly
Run this inside of a directory without a package.json
Expected Behavior
Expect it to be able to just install dependencies the way npx normally would. Then run the command
Should not fail because it doesn't find a package.json in the working directory
Who
n/a
References
n/a
The text was updated successfully, but these errors were encountered:
What / Why
This is a contrived example to display the issue. The real issue arose for me when attempting to run a yeoman generator, which requires 2 dependencies, hence the need to run with
-p
.npx -p yo -p generator-codfish -c 'yo codfish'
Details
When
Where
How
Current Behavior
When I run the same command in directory with a
package.json
it works as expected. It does NOT mutate the package.json and doesn't install any modules in that directory, which is to be expected. However it's still failing unless you actually have a package.json file in the cwdSteps to Reproduce
Expected Behavior
Who
References
The text was updated successfully, but these errors were encountered: