Reputation: 335
I'm getting an error running npm install on my project in Ubuntu 16.04
I can't figure out if this is a problem with npm, or execsync, or maybe angular? It installs and builds fine in Windows 10, which is also confusing me. I'm not able to launch my MEAN stack website because I can't get past these errors.
npm -v: 3.5.2
Here is the error.
> [email protected] install /home/tony/web/sa_website/node_modules/execSync
> node install.js
sh: 1: node: not found
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm WARN @angular/[email protected] requires a peer of [email protected] but none was installed.
npm WARN @angular/[email protected] requires a peer of [email protected] but none was installed.
npm WARN @angular/[email protected] requires a peer of [email protected] but none was installed.
npm ERR! Linux 4.8.0-58-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] install: `node install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install script 'node install.js'.
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 execSync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs execSync
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls execSync
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/tony/web/sa_website/npm-debug.log
And the error seen at the end of npm-debug.log
640 warn optional Skipping failed optional dependency /chokidar/fsevents:
641 warn notsup Not compatible with your operating system or architecture: [email protected]
642 warn @angular/[email protected] requires a peer of [email protected] but none was installed.
643 warn @angular/[email protected] requires a peer of [email protected] but none was installed.
644 warn @angular/[email protected] requires a peer of [email protected] but none was installed.
645 verbose stack Error: [email protected] install: `node install.js`
645 verbose stack spawn ENOENT
645 verbose stack at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:17:16)
645 verbose stack at emitTwo (events.js:87:13)
645 verbose stack at ChildProcess.emit (events.js:172:7)
645 verbose stack at maybeClose (internal/child_process.js:821:16)
645 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
646 verbose pkgid [email protected]
647 verbose cwd /home/tony/web/sa_website
648 error Linux 4.8.0-58-generic
649 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
650 error node v4.2.6
651 error npm v3.5.2
652 error file sh
653 error code ELIFECYCLE
654 error errno ENOENT
655 error syscall spawn
656 error [email protected] install: `node install.js`
656 error spawn ENOENT
657 error Failed at the [email protected] install script 'node install.js'.
657 error Make sure you have the latest version of node.js and npm installed.
657 error If you do, this is most likely a problem with the execSync package,
657 error not with npm itself.
657 error Tell the author that this fails on your system:
657 error node install.js
657 error You can get information on how to open an issue for this project with:
657 error npm bugs execSync
657 error Or if that isn't available, you can get their info via:
657 error npm owner ls execSync
657 error There is likely additional logging output above.
658 verbose exit [ 1, true ]
And here is package.json
{
"name": "angular2-nodejs",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www",
"build": "del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch",
"build:prod": "del-cli public/js/app && ngc -p tsconfig.aot.json && ngc -p tsconfig.aot.json && webpack --config webpack.config.prod.js --progress --profile --bail && del-cli 'public/js/app/**/*.js' 'public/js/app/**/*.js.map' '!public/js/app/bundle.js' '!public/js/app/*.chunk.js' 'assets/app/**/*.ngfactory.ts' 'assets/app/**/*.shim.ts'",
"ngc" : "ngc"
},
"dependencies": {
"@angular/common": "2.0.1",
"@angular/compiler": "2.0.1",
"@angular/compiler-cli": "0.6.3",
"@angular/core": "2.0.1",
"@angular/forms": "2.0.1",
"@angular/http": "2.0.1",
"@angular/platform-browser": "2.0.1",
"@angular/platform-browser-dynamic": "2.0.1",
"@angular/platform-server": "2.0.1",
"@angular/router": "3.0.1",
"@angular/upgrade": "2.0.1",
"body-parser": "~1.15.1",
"cookie-parser": "~1.4.3",
"core-js": "^2.4.1",
"debug": "~2.2.0",
"express": "~4.13.4",
"hbs": "~4.0.0",
"morgan": "~1.7.0",
"rxjs": "5.4.3",
"serve-favicon": "~2.3.0",
"zone.js": "^0.6.25"
},
"devDependencies": {
"@types/core-js": "0.9.34",
"@types/node": "6.0.45",
"angular2-router-loader": "^0.3.2",
"angular2-template-loader": "^0.5.0",
"awesome-typescript-loader": "^2.2.4",
"aws-sdk": "^2.79.0",
"del-cli": "^0.2.0",
"express": "^4.13.4",
"file-loader": "^0.11.2",
"html-loader": "^0.4.4",
"image-webpack-loader": "^3.3.1",
"nodemailer": "^4.0.1",
"raw-loader": "^0.5.1",
"typescript": "2.0.3",
"webpack": "2.1.0-beta.21",
"webpack-merge": "^0.14.1"
}
}
Upvotes: 1
Views: 1156
Reputation: 981
As mentioned in the comments by R. Richards, your node version is not supported by angular, just update node with
sudo npm install -g n
sudo n latest
and then just run
npm install -g npm
to upgrade npm
Upvotes: 1