Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Installing in docker is broken #6

Open
Rush opened this issue Sep 3, 2016 · 3 comments
Open

Installing in docker is broken #6

Rush opened this issue Sep 3, 2016 · 3 comments

Comments

@Rush
Copy link

Rush commented Sep 3, 2016

> docker pull node
> docker run -it node /bin/bash
root@4a251ed35176:/# mkdir test
root@4a251ed35176:/# cd test
root@4a251ed35176:/test# npm init -y
root@4a251ed35176:/test# npm install --save fast-xml2js
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info attempt registry request try #1 at 9:36:57 PM
npm http request GET https://registry.npmjs.org/fast-xml2js
npm http 304 https://registry.npmjs.org/fast-xml2js
npm info addNameTag [ 'fast-xml2js', 'latest' ]
npm info lifecycle [email protected]~preinstall: [email protected]
npm WARN lifecycle [email protected]~preinstall: cannot run in wd %s %s (wd=%s) [email protected] node-gyp configure && node-gyp build /test/node_modules/.staging/fast-xml2js-5c4308bb
npm info linkStuff [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
[email protected] /test
`-- [email protected] 

npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm info ok
root@4a251ed35176:/test# node -r fast-xml2js -e 'true'   
module.js:457
    throw err;
    ^

Error: Cannot find module './fast-xml2js/fast-xml2js.node'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/test/node_modules/fast-xml2js/index.js:1:80)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)

This has something to do with the way node-gyp is set up with this package: http://stackoverflow.com/a/19132229/403571

It seems the workaround is npm install --unsafe-perm.

The problem does not exist in other native modules.

@cmrigney
Copy link
Owner

cmrigney commented Sep 4, 2016

Thanks for the issue report. Could you provide an example of a native module that doesn't have this issue so I can see what they are doing?

@Rush
Copy link
Author

Rush commented Sep 4, 2016

This builds well https://github.com/hooklift/node-libvirt

@cmrigney
Copy link
Owner

cmrigney commented Apr 5, 2017

@Rush I've run into the same issue. Any idea how node-libvirt does it without --unsafe-perm?

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

No branches or pull requests

2 participants