- Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
Bugthing that needs fixingthing that needs fixingPriority 1high priority issuehigh priority issueRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Run the following npx command in a directory that has an existing node_modules with one of the modules already installed. When mixing implict and specific like below, npx crashes when it tries to tread undefined as a string.
$ npx -p [email protected] -p @babel/core gitmoji -l npm ERR! Cannot read property 'replace' of undefined Here is the stack trace from the debug log:
32 verbose stack TypeError: Cannot read property 'replace' of undefined 32 verbose stack at .nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:163:47 32 verbose stack at Array.map (<anonymous>) 32 verbose stack at exec (.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:163:31) Not sure if it crashes because of the missing version specifier @babel/core when it already has a fixed version in package.json or something else.
Expected Behavior
Expect it to prompt for installation (the first time it is run):
$ npx -p [email protected] -p @babel/core@7 gitmoji -l Need to install the following packages: @babel/core@7 [email protected] Ok to proceed? (y) Steps To Reproduce
# create a new dir with an empty package.json mkdir fresh-dir && cd fresh-dir && npm init -y npm i @babel/core npx -p [email protected] -p @babel/core gitmoji -l Environment
- OS: Ubuntu 21.04
- Node: 14.16.0
- npm: 7.21.0
SpawnAtis
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingPriority 1high priority issuehigh priority issueRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release