-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
Bugthing that needs fixingthing that needs fixingRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release
Milestone
Description
Current Behavior:
I tested installing a git dependency which has either prepare or prepack script with npm CLI v7.0.0-beta.12 and confirmed the following behaviors.
- a package with a
preparescript:devDependenciesare NOT installed but thepreparescript is executed - a package with a
prepackscript:devDependenciesare NOT installed and theprepackscript is NOT executed
Expected Behavior:
- a package with a
preparescript:devDependenciesare installed and thepreparescript is executed - a package with a
prepackscript:devDependenciesare installed and theprepackscript is executed- Though I've not found any document saying that
devDependenciesare installed when installing a git dependency with aprepackscript and actually they are not installed even when npm CLI v6 is used, I believe npm should install them since running aprepackscript without installingdevDependenciesdoes not make sense.
- Though I've not found any document saying that
Steps To Reproduce:
prepare:
// https://github.com/kimamula/prepare-test/blob/master/package.json
{
"name": "prepare-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "tsc"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"typescript": "^4.0.3"
}
}$ npm install github:kimamula/prepare-test
npm ERR! code 127
npm ERR! git dep preparation failed
npm ERR! command /Users/kenji/.nodenv/versions/12.18.3/bin/node /Users/kenji/.nodenv/versions/12.18.3/lib/node_modules/npm/bin/npm-cli.js install --only=dev --prod --ignore-prepublish --no-progress --no-save --cache=/Users/kenji/.npm/_cacache --prefer-offline=false --prefer-online=false --offline=false --before=
npm ERR! > [email protected] prepare
npm ERR! > tsc
npm ERR! npm WARN invalid config before="" set in command line options
npm ERR! npm WARN invalid config Must be one of: null, valid Date string
npm ERR! sh: tsc: command not found
npm ERR! npm ERR! code 127
npm ERR! npm ERR! path /Users/kenji/.npm/_cacache/tmp/git-clone-a73f300b
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c tsc
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! /Users/kenji/.npm/_cacache/_logs/2020-09-27T06_13_19_941Z-debug.log
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kenji/.npm/_logs/2020-09-27T06_13_19_972Z-debug.logprepack:
// https://github.com/kimamula/prepack-test/blob/master/package.json
{
"name": "prepack-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prepack": "tsc"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"typescript": "^4.0.3"
}
}$ npm install github:kimamula/prepack-test
changed 1 package, and audited 1 package in 6s
found 0 vulnerabilities-> tsc should generate index.js file, but it's not generated.
Environment:
- OS: macOS 10.15.6
- Node: 12.18.3
- npm: 7.0.0-beta.12
aomarks, zloirock, skanaar, mrxdst, NiklasRz and 4 more
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release