-
Notifications
You must be signed in to change notification settings - Fork 30
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
bin/postinstall.js fails when installing the runtime #119
Comments
I forgot to include information about my system. Here it is:
|
OS: Ubuntu
|
I could fix this by upgrading node to exactly the version required: nvm install 5.10.0
nvm use 5.10.0
npm install -g qbrt |
Per the stack trace, the code in qbrt that triggers the error is bin/install-runtime.js:261:27, which tries to delete the temporary directory that the post-install script uses: return pify(fs.remove)(tempDir); The error message "rimraf: missing path" suggests that the temporary directory doesn't exist. But that's strange, because the fs.remove call is actually a call to fs-extra.remove, which says it behaves like
So I'm not sure what's happening here. However, it shouldn't be related to your version of Node. I can install qbrt on an Ubuntu machine using Node 8:
I wonder if this has anything to do with outdated dependencies. Over in #124 I added testing for Node.js version 8, and Node 8 builds are failing with "Invalid Version: https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.1.tgz". Meanwhile, over in #123 I'm switching from package-lock.json to npm-shrinkwrap.json, and I recreated that file from scratch (after merging a few updates to dependencies). I'll release version 0.2.1 after merging #123, after which I recommend trying again with Node 8 to see if it works for you! |
I've now updated qbrt to v0.2.1 after updating dependencies and switching from package-lock.json to npm-shrinkwrap.json. You should try reinstalling qbrt and see if it works now with Node 8. I also took a look at the log file you referenced, and strangely, I don't see the same output you excerpted. There's no reference to install-runtime.js there; rather, this different error is reported:
If the update doesn't fix the problem, then there may be something else going on, and we should investigate further. |
Nothing changed with 0.2.1:
Strangely, cloning the git repo (at commit 01ab20d) and running Another weird thing, which I haven't experienced with other npm modules, is that running
If it wasn't for this, I would have tried to do some investigation myself, but since the issue can't be reproduced with local installs (without |
This reminds me of an issue I had installing Node modules in a Docker container. It might be because of how npm handles installation using sudo. Related issues from other projects include homebridge/homebridge#484 and nodejs/node-gyp#115. If the issue you're experiencing is the same one, then adding --unsafe-perm to the install command should fix it, i.e. One option is to change ownership of /usr/local/lib (or wherever NPM installs packages) to your user, which seems to be a popular option on macOS (probably because HomeBrew recommends it), i.e. A second option is to "use nvm", although I haven't found good documentation for what this means exactly, and nvm-sh/nvm#668 suggests that it could get cumbersome if you regularly switch between Node versions, since then "global" modules will be Node version-specific. A third option is to create a user-specific directory for "global" modules and tell NPM to install them there instead, as described in the document Install npm packages globally without sudo on macOS and Linux. |
I can't install this with npm. The output of
sudo npm install -g qbrt
:The complete
/root/.npm/_logs/2017-07-30T14_16_24_901Z-debug.log
file (with a.txt
extension, because GitHub): 2017-07-30T14_16_24_901Z-debug.log.txtThe text was updated successfully, but these errors were encountered: