I downloaded the latest version of Node.js (0.8.8) and it works all fine and dandy, but the NPM that is packaged with the Node.js installation is now failing. It worked when I had an outdated version of Node.js (0.5.x) and I could type commands like
npm --version
and It would return the current version of NPM. However when I do any command (even the one above) I receieve this error
$ npm -v
/usr/lib/node_modules/npm/lib/utils/config-defs.js:5
, stdio = process.binding("stdio")
^
Error: No such module
at Object.<anonymous> (/usr/lib/node_modules/npm/lib/utils/config-defs.js:5:21)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/usr/lib/node_modules/npm/lib/utils/ini.js:43:18)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
I am using NPM version 1.1.59
Note: I have tried updating NPM with
$ curl -L curl http://npmjs.org/install.sh | sudo sh
But that didn't work either.
Thanks to Sean's comment on an answer at his own post, I got it. After I removed the npm module from
/usr/lib/node_modules/
and the binary from
/usr/bin/
It's all now working.
I think after installing the latest Node.js it might have conflicted, because both paths were global. Hope this helps anyone in the future :-)
Related
Just trying to learn Nativescript using the Nativescript CLI and an Angular Framewok.
tns create myapp --ng
Then after answering the questions, I move on to:
ng generate --help
Which gives this error:
An unhandled exception occurred: Cannot find module '#schematics/angular/utility/config'
See "/tmp/ng-V5J95L/angular-errors.log" for further details.
The log file contains:
[error] Error: Cannot find module '#schematics/angular/utility/config'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/usr/lib/node_modules/#nativescript/schematics/src/angular-project-parser.js:6:18)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
npm i -D #nativescript/schematics
then
npm i -D #angular/cli
restart the terminal/ command line and then again
ng g c <Component/name>
The solution for me turned out be be because I had installed and was using version 12.x of Node.js, the fix was to use the Long Term Support (LTS) version 10.x of Node.js.
After installing heroku using npm install -g heroku-cli in Windows 8.1, I'm getting this error on heroku --version
C:\Users\Lenovo\AppData\Roaming\npm\node_modules\heroku-cli\node_modules\cli-eng
ine\lib\cli.js:70
async run() {
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\hero
ku-cli\bin\run.js:2:34)
The Heroku CLI requires node >=7.10.0 or greater
Go to the NodeJS website and download the latest version (Now: v8.1.2 Current).
After installation test the Heroku Toolbelt by using the version command in your command line interface:
> heroku version
I am using mac osX Sierra When angular-cli was not installing I tried force install , tried installation by yarn but nothing changed those installation said that angular-cli was installed successfully but when i write ng -v or ng --version or ng --help or ng -help all the time i gave me same error massage and i could not work with angular cli :(
success Installed angular-cli#1.0.0-beta.19-3 with binaries:
- ng
✨ Done in 24.96s.
MDSAZIDs-iMac:~ MYMAC$ ng -v
module.js:457
throw err;
^
Error: Cannot find module 'rsvp'
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> (/Users/MYMAC/node_modules/angular-cli/node_modules/ember-cli/lib/ext/promise.js:3:15)
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)
I'm working with Laravel 5 (Elixir) and homestead v2.5 in Ubuntu 14.10. When I typed gulp and press enter in homestead ssh, I found the following error:
Error: Cannot find module './lib/notifiers/notify-send'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/vagrant/Code/rumta/node_modules/laravel-elixir/node_modules/gulp-notify/node_modules/node-notifier/index.js:2:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
What should I do to solved this problem?
This happened to me too with an unfinished previous installation.
A better solution I found was just removing node_modules/ folder inside my project and run again [sudo] npm install.
Hope this helps somebody else, regards!
Update Note: "sudo" is not needed, a better practice is solve permissions issue in npm following this guide
SOLVED!
Make new project and run sudo npm install.
I get the following error when I run below command..
⚡ sudo npm -g install testacular
module.js:340
throw err;
^
Error: Cannot find module 'npmlog'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at /usr/local/bin/npm:19:11
at Object.<anonymous> (/usr/local/bin/npm:87:3)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
Try re-installing node.js - http://nodejs.org/download/
This happened to me after an old version of n failed to install node v0.10.5, then I upgraded n and had it install node. It apparently didn't install npm quite correctly.