Skip to content
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

fails to install module when executed in cli using a postinstall script for a globally installed module #27

Open
borisdiakur opened this issue Dec 22, 2016 · 2 comments

Comments

@borisdiakur
Copy link

borisdiakur commented Dec 22, 2016

I’m trying to install and require major versions of lodash using a postinstall script for n_. However npm-install-version fails to install lodash. Here is how to reproduce the issue:

$ npm install [email protected] -g ; n_3

Here is the result:

$  ~/Workspace/n_ (master)$ ls -alh /usr/local/lib/node_modules/n_/node_modules/lodash\@\^3.10.1/
total 0
drwxr-xr-x  3 boris  admin   102B Dec 22 17:14 .
drwxr-xr-x  8 boris  admin   272B Dec 22 17:14 ..
drwxr-xr-x  2 boris  admin    68B Dec 22 17:14 node_modules
$ ls -alh /usr/local/lib/node_modules/n_/node_modules/lodash\@\^3.10.1/node_modules/
total 0
drwxr-xr-x  2 boris  admin    68B Dec 22 17:14 .
drwxr-xr-x  3 boris  admin   102B Dec 22 17:14 ..

References:
borisdiakur/n_#18

@scott113341
Copy link
Owner

Thanks @borisdiakur, I'll look into this

@DLehenbauer
Copy link

I believe I've hit the same issue. Invoking 'nvi' from a postinstall script works on the first invocation of npm install, but all subsequent invocations of npm install fail with:

$ npm i                                                                                                                                                                 (perf✱)
npm ERR! path [...]/clarinet/node_modules/npm/node_modules/dezalgo
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '[...]/clarinet/node_modules/npm/node_modules/dezalgo' -> '[...]/clarinet/node_modules/npm/node_modules/.dezalgo.DELETE'
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/danlehen/.npm/_logs/2019-01-04T15_44_15_175Z-debug.log

To recover, I deleted my package-lock.json and /node_modules/.

Full repro:

$ git clone https://github.com/DLehenbauer/clarinet.git
$ cd clarinet
$ git checkout nvi-repro
$ npm i
$ npm i

The first npm i works as expected. The second fails as described above.

MacOS v10.14.2
node v8.11.4
npm v5.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants