Closed oshi97 closed 1 year ago
@oshi97 I'm unable to reporoduce this issue. In my case test.txt file gets created. Please share more details / anything I'm missing to reproduce this issue.
happens to me as well, node 16.15.0, npm 8.5.5. I also tried the steps given here to reproduce and I can confirm the issue. I am running on macOS Monterey (MacBook Pro 16-inch, 2019)
@oshi97 I'm unable to reporoduce this issue. In my case test.txt file gets created. Please share more details / anything I'm missing to reproduce this issue.
It could be your npm version?
I've noticed that npm install <pkg-name>
seems to not run the postinstall for instances where node_modules have not changed. For instance, if I run npm install blah
as a new dependency, the postinstall would run, but running npm install blah
will not run the postinstall. However if I try to npm install blah@aDifferentVersion
the postinstall will run. From an outside perspective I feel like this could be related to npm installing a local folder, since a local folder install will create a symlink instead of copying local files, and may even be intentional behavior.
We're seeing the same issue on node 16.15.0 with npm 8.5.5. It worked previously on node 16.14.2 with npm 8.5.0.
Same here. postinstall
doesn't run on Node 16.15.0 with npm 8.5.5, but it works fine in node 16.14.2 with npm 8.5.0
The setup is with NPM workspaces, where one of the workspace is a dependency of another and it contains a postinstall
script.
Updating npm
to 8.10.0 seems to fix this issue for me tho
I also encountered a similar problem.
When installing packages like yorkie
, the life cycle of install, including install
and postinstall
, was not triggered.
node: 16.15.0 npm: 8.5.5
When switching to version 14, it works normally.
I have encountered the same issue on Windows 10 Pro with node 16.15.0 and npm 8.5.5.
I thought I have done anything wrong with my package.json until I have searched this behavior as an issue.
This issue is still present in node v19.9.0 (npm v9.6.3)
I can only get the postinstall script to run by reverting to an earlier version of node.
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Installing a local npm package does not run the postinstall script.
Expected Behavior
The postinstall script runs, and in this case creates a new file
Steps To Reproduce
git clone https://github.com/oshi97/install-links.git
git checkout postinstall
cd parent
npm i ../child
Environment
//registry.npmjs.org/:_authToken = (protected)
; node bin location = /Users/oshi/.nvm/versions/node/v16.14.2/bin/node ; node version = v16.14.2 ; npm local prefix = /Users/oshi/techops/install-links-test/parent ; npm version = 8.7.0 ; cwd = /Users/oshi/techops/install-links-test/parent ; HOME = /Users/oshi ; Run
npm config ls -l
to show all defaults.