ignite: install fails on global install

Hiya! So you think it’s broken or missing a feature eh?

Welllllll, it just might be. Do me a favor and check the following.

  • [ x ] Issue does not already exist
  • Identify exactly what aspect your issue is about
    • [x ] ignite base application
    • ignite the cli
    • ignite generated code

I’ve tried reinstalling node from homebrew, and have cleaned out ~/.node and ~/.npm

Then when it fails to install a specific module, i try to install that individually, and eventually end up in the same place:


Here’s the command line output: (Problem with duplexer so I install that directly sudo npm install -g duplexer

npm ERR! Darwin 14.5.0 npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “i” “-g” “generator-react-native-ignite” npm ERR! node v6.2.2 npm ERR! npm v3.8.6 npm ERR! path /Users/selly/.npm/duplexer2/0.0.2/package.tgz.868533109 npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall open

npm ERR! Error: EACCES: permission denied, open ‘/Users/selly/.npm/duplexer2/0.0.2/package.tgz.868533109’ npm ERR! at Error (native) npm ERR! { Error: EACCES: permission denied, open ‘/Users/selly/.npm/duplexer2/0.0.2/package.tgz.868533109’ npm ERR! at Error (native) npm ERR! errno: -13, npm ERR! code: ‘EACCES’, npm ERR! syscall: ‘open’, npm ERR! path: ‘/Users/selly/.npm/duplexer2/0.0.2/package.tgz.868533109’, npm ERR! parent: ‘multipipe’ } npm ERR! npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request: npm ERR! /usr/local/lib/node_modules/react-native-ignite/npm-debug.log /usr/local/lib └── (empty)

npm ERR! Darwin 14.5.0 npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “-g” “react-native-ignite” npm ERR! node v6.2.2 npm ERR! npm v3.8.6 npm ERR! code ELIFECYCLE

npm ERR! react-native-ignite@1.1.0 postinstall: npm i -g generator-react-native-ignite npm ERR! Exit status 243 npm ERR! npm ERR! Failed at the react-native-ignite@1.1.0 postinstall script ‘npm i -g generator-react-native-ignite’. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the react-native-ignite package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm i -g generator-react-native-ignite npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs react-native-ignite npm ERR! Or if that isn’t available, you can get their info via: npm ERR! npm owner ls react-native-ignite npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/selly/npm-debug.log


Then I get this

react-native-ignite@1.1.0 postinstall /usr/local/lib/node_modules/react-native-ignite npm i -g generator-react-native-ignite

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/generator-react-native-ignite /usr/local/lib └── generator-react-native-ignite@1.1.0

npm ERR! Darwin 14.5.0 npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “i” “-g” “generator-react-native-ignite” npm ERR! node v6.2.2 npm ERR! npm v3.8.6 npm ERR! path /usr/local/lib/node_modules/generator-react-native-ignite npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules/generator-react-native-ignite’ npm ERR! at Error (native) npm ERR! { Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules/generator-react-native-ignite’ npm ERR! at Error (native) npm ERR! errno: -13, npm ERR! code: ‘EACCES’, npm ERR! syscall: ‘access’, npm ERR! path: ‘/usr/local/lib/node_modules/generator-react-native-ignite’ } npm ERR! npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request: npm ERR! /usr/local/lib/node_modules/react-native-ignite/npm-debug.log /usr/local/lib └── (empty)

npm ERR! Darwin 14.5.0 npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “-g” “react-native-ignite” npm ERR! node v6.2.2 npm ERR! npm v3.8.6 npm ERR! code ELIFECYCLE

npm ERR! react-native-ignite@1.1.0 postinstall: npm i -g generator-react-native-ignite npm ERR! Exit status 243 npm ERR! npm ERR! Failed at the react-native-ignite@1.1.0 postinstall script ‘npm i -g generator-react-native-ignite’. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the react-native-ignite package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm i -g generator-react-native-ignite npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs react-native-ignite npm ERR! Or if that isn’t available, you can get their info via: npm ERR! npm owner ls react-native-ignite npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/selly/npm-debug.log npm ERR! code 1 jarvis:~ selly$


npm-debug.log.txt

But then you take a look (i’ve already chmod777’ed it):

jarvis:~ selly$ ll /usr/local/lib/node_modules/ total 0 drwxrwxrwx 7 selly wheel 238B Jun 30 11:35 .


Then I get something like this sometimes:

`` Here’s the error I’m getting at the end of npm-debug.log:

56447 silly lifecycle react-native-ignite@1.1.0~postinstall: Args: [ ‘-c’, ‘npm i -g generator-react-native-ignite’ ] 56448 silly lifecycle react-native-ignite@1.1.0~postinstall: Returned: code: 243 signal: null 56449 info lifecycle react-native-ignite@1.1.0~postinstall: Failed to exec postinstall script 56450 verbose unlock done using /Users/selly/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging 56451 silly rollbackFailedOptional Starting 56452 silly rollbackFailedOptional Finishing 56453 silly runTopLevelLifecycles Starting 56454 silly runTopLevelLifecycles Finishing 56455 silly install printInstalled 56456 verbose stack Error: react-native-ignite@1.1.0 postinstall: npm i -g generator-react-native-ignite 56456 verbose stack Exit status 243 56456 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:239:16) 56456 verbose stack at emitTwo (events.js:106:13) 56456 verbose stack at EventEmitter.emit (events.js:191:7) 56456 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) 56456 verbose stack at emitTwo (events.js:106:13) 56456 verbose stack at ChildProcess.emit (events.js:191:7) 56456 verbose stack at maybeClose (internal/child_process.js:852:16) 56456 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) 56457 verbose pkgid react-native-ignite@1.1.0 56458 verbose cwd /Users/selly 56459 error Darwin 14.5.0 56460 error argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “-g” “react-native-ignite” 56461 error node v6.2.2 56462 error npm v3.8.6 56463 error code ELIFECYCLE 56464 error react-native-ignite@1.1.0 postinstall: npm i -g generator-react-native-ignite 56464 error Exit status 243 56465 error Failed at the react-native-ignite@1.1.0 postinstall script ‘npm i -g generator-react-native-ignite’. 56465 error Make sure you have the latest version of node.js and npm installed. 56465 error If you do, this is most likely a problem with the react-native-ignite package, 56465 error not with npm itself. 56465 error Tell the author that this fails on your system: 56465 error npm i -g generator-react-native-ignite 56465 error You can get information on how to open an issue for this project with: 56465 error npm bugs react-native-ignite 56465 error Or if that isn’t available, you can get their info via: 56465 error npm owner ls react-native-ignite 56465 error There is likely additional logging output above. 56466 verbose exit [ 1, true ] ``

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 17 (4 by maintainers)

Most upvoted comments

i managed to fix this issue by following this guide: https://docs.npmjs.com/getting-started/fixing-npm-permissions

+1 on this issue, but I have a workaround/better practice solution. It all boils down to attempting to use npm as a system (root) package manager - DON’T. It breeds permission issues. Also, do you trust every postinstall script in the entire dependency tree to run as root? What you probably want is a user-specific NPM prefix for all your global installs to go under. That way, npm install -g actually works without sudo or janky security-breaking recursive chowns.

Here’s how I fixed it:

$ mkdir '~/.local/share/npm-packages/'
$ npm config set prefix '~/.local/share/npm-packages/'

Add to ~/.bashrc or similar:

export PATH="$PATH:$HOME/.local/share/npm-packages/bin"

Now npm install -g react-native-ignite works!

For posterity, here’s the exact issue I was seeing, even running under a root login shell:

root@tesla:/home/giacomo# npm install -g react-native-ignite
npm WARN deprecated cross-spawn-async@2.2.4: cross-spawn no longer requires a build toolchain, use it instead!
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
/usr/local/bin/ignite -> /usr/local/lib/node_modules/react-native-ignite/index.js

> spawn-sync@1.0.15 postinstall /usr/local/lib/node_modules/react-native-ignite/node_modules/spawn-sync
> node postinstall


> yo@1.8.4 postinstall /usr/local/lib/node_modules/react-native-ignite/node_modules/yo
> yodoctor


Yeoman Doctor
Running sanity checks on your system

✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version

Everything looks all right!

> react-native-ignite@1.3.2 postinstall /usr/local/lib/node_modules/react-native-ignite
> npm i -g generator-react-native-ignite

npm ERR! Linux 4.4.0-31-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "i" "-g" "generator-react-native-ignite"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! path /root/.npm/generator-react-native-ignite/1.3.2/package
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir '/root/.npm/generator-react-native-ignite/1.3.2/package'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES: permission denied, mkdir '/root/.npm/generator-react-native-ignite/1.3.2/package']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/root/.npm/generator-react-native-ignite/1.3.2/package' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/local/lib/node_modules/react-native-ignite/npm-debug.log
/usr/local/lib
└── (empty)

npm ERR! Linux 4.4.0-31-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "react-native-ignite"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! react-native-ignite@1.3.2 postinstall: `npm i -g generator-react-native-ignite`
npm ERR! Exit status 243
npm ERR! 
npm ERR! Failed at the react-native-ignite@1.3.2 postinstall script 'npm i -g generator-react-native-ignite'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-native-ignite package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm i -g generator-react-native-ignite
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs react-native-ignite
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls react-native-ignite
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/giacomo/npm-debug.log
npm ERR! code 1

I’m sure we can. Might want to create a ticket @jamonholmgren