error with yo while performing npm install on mac OS X
Error while performing npm install
npm install
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
> [email protected] postinstall /Users/alokkulkarni/Documents/JavaSamples/micro/gateTest/node_modules/yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
/Users/alokkulkarni/Documents/JavaSamples/micro/gateTest/node_modules/yeoman-doctor/lib/rules/node_path.js:35
throw err;
^
Error: ENOTDIR: not a directory, lstat '/Applications/Kitematic (Beta).app/Contents/Resources/app.asar/node_modules'
at Error (native)
at Object.fs.lstatSync (fs.js:982:18)
at Object.realpathSync (fs.js:1647:19)
at fixPath (/Users/alokkulkarni/Documents/JavaSamples/micro/gateTest/node_modules/yeoman-doctor/lib/rules/node_path.js:32:20)
at Array.map (native)
at Object.exports.verify (/Users/alokkulkarni/Documents/JavaSamples/micro/gateTest/node_modules/yeoman-doctor/lib/rules/node_path.js:48:71)
at Immediate.<anonymous> (/Users/alokkulkarni/Documents/JavaSamples/micro/gateTest/node_modules/yeoman-doctor/lib/index.js:15:10)
at runCallback (timers.js:580:20)
at tryOnImmediate (timers.js:554:5)
at processImmediate [as _immediateCallback](timers.js:533:5)
[email protected] /Users/alokkulkarni/Documents/JavaSamples/micro/gateTest
└── (empty)
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.4.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `yodoctor`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'yodoctor'.
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 yo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! yodoctor
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs yo
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls yo
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/alokkulkarni/Documents/JavaSamples/micro/gateTest/npm-debug.log
npm ERR! code 1
yo --version && echo $PATH $NODE_PATH && node -e 'console.log(process.platform, process.versions)' && cat Gruntfile.js
1.8.4
/Users/alokkulkarni/Documents/JavaSamples/google-cloud-sdk/bin:/Users/alokkulkarni/.sdkman/candidates/springboot/current/bin:/Users/alokkulkarni/.sdkman/candidates/scala/current/bin:/Users/alokkulkarni/.sdkman/candidates/groovy/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/alokkulkarni/Maven/apache-maven-3.3.9/bin:/usr/local/opt/rabbitmq/sbin /Applications/Kitematic (Beta).app/Contents/Resources/app.asar/node_modules
darwin { http_parser: '2.7.0',
node: '6.4.0',
v8: '5.0.71.60',
uv: '1.9.1',
zlib: '1.2.8',
ares: '1.10.1-DEV',
icu: '57.1',
modules: '48',
openssl: '1.0.2h' }
cat: Gruntfile.js: No such file or directory
I've also run into a similar error. I never even got to the yodoctor command...
$ npm install -g yo
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
/Users/stefanvlahov/.node_modules_global/bin/yo -> /Users/stefanvlahov/.node_modules_global/lib/node_modules/yo/lib/cli.js
/Users/stefanvlahov/.node_modules_global/bin/yo-complete -> /Users/stefanvlahov/.node_modules_global/lib/node_modules/yo/lib/completion/index.js
> [email protected] postinstall /Users/stefanvlahov/.node_modules_global/lib/node_modules/yo/node_modules/spawn-sync
> node postinstall
>
> [email protected] postinstall /Users/stefanvlahov/.node_modules_global/lib/node_modules/yo
> yodoctor
sh: yodoctor: command not found
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/Users/stefanvlahov/.node_modules_global/bin/npm" "install" "-g" "yo"
npm ERR! node v6.5.0
npm ERR! npm v3.10.6
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] postinstall: `yodoctor`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'yodoctor'.
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 yo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! yodoctor
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs yo
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls yo
npm ERR! There is likely additional logging output above.
@stefanvlahov I had the same issue. yo 1.8.5, node 4.5.0, npm 3.10.6 I installed the yeoman-doctor package first, then I was able to install yo.
@silic0ns0ul you need to add the npm binaries to your system PATH variable. Google is your friend if you need help on how to proceed.
the main issue is if i have a base npm installtion on my machine with a node_modules package and then i have downloaded another application on mac which is having its own node_moduled within the app content and a reference to app in my path variable, yoeman scripts are not able to get the base due to paths. But since my newly installed app has a generic path which should be ignored. But in the original case it fails as yodoctor is validating both paths. This is somethin to be built in yo scripts to only check for base npm installation paths which is /usr/local/bin rather than any other NPM path.
/usr/local/bin is not where npm install binaries.
I'm also experiencing this, see error log below.
What I find most weird is that in my error log, this line - '/Applications/Atom.app/Contents/Resources/app.asar/exports' - implies that Atom has something to do with it. While for @alokkulkarni the same line says Kitematic (Beta).
% npm -g install yo
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
/Users/alextegelid/.npm-packages/bin/yo -> /Users/alextegelid/.npm-packages/lib/node_modules/yo/lib/cli.js
/Users/alextegelid/.npm-packages/bin/yo-complete -> /Users/alextegelid/.npm-packages/lib/node_modules/yo/lib/completion/index.js
> [email protected] postinstall /Users/alextegelid/.npm-packages/lib/node_modules/yo/node_modules/spawn-sync
> node postinstall
> [email protected] postinstall /Users/alextegelid/.npm-packages/lib/node_modules/yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
/Users/alextegelid/.npm-packages/lib/node_modules/yo/node_modules/yeoman-doctor/lib/rules/node_path.js:35
throw err;
^
Error: ENOTDIR: not a directory, lstat '/Applications/Atom.app/Contents/Resources/app.asar/exports'
at Error (native)
at Object.fs.lstatSync (fs.js:982:18)
at Object.realpathSync (fs.js:1647:19)
at fixPath (/Users/alextegelid/.npm-packages/lib/node_modules/yo/node_modules/yeoman-doctor/lib/rules/node_path.js:32:20)
at Array.map (native)
at Object.exports.verify (/Users/alextegelid/.npm-packages/lib/node_modules/yo/node_modules/yeoman-doctor/lib/rules/node_path.js:48:71)
at Immediate.<anonymous> (/Users/alextegelid/.npm-packages/lib/node_modules/yo/node_modules/yeoman-doctor/lib/index.js:15:10)
at runCallback (timers.js:580:20)
at tryOnImmediate (timers.js:554:5)
at processImmediate [as _immediateCallback] (timers.js:533:5)
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "-g" "install" "yo"
npm ERR! node v6.4.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `yodoctor`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'yodoctor'.
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 yo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! yodoctor
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs yo
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls yo
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/alextegelid/npm-debug.log
I have no idea whats going on with this errors.
This goes to the ones who still struggle with install errors ➡️ Could you please do me a favor and try to:
- Update Node
- Update npm
Then:
npm uninstall -g yo
npm cache clean
npm install -g yo
In case you can’t update node and npm: Leave your versions over here to make ist possible to try to reproduce errors:
npm --version
node --version
Thanks, Michael
... in my case, NODE_PATH was incorrectly set by Kitematic (see issue here https://github.com/docker/kitematic/issues/766)
... yodoctor's error is misleading, but in general just check the NODE_PATH variable is set correctly.
Tried to install 1.8.5, got the error in question.
Attached the log file below.
npm-debug.log.txt
Quick update. Installing in native Terminal on macOS worked. Error happened in iTerm.
@michalpiekarski then you probably have an env set in iterm or its loading a different profile.
Closing as this seems to be a user env problem, and one thats different for every user.
To troubleshoot, first try echo $NODE_PATH and see if its what you expect it to be.