Error on npm run build. Updating the node-modules or clearing the cache didn't work. Updating the scripts even didn't work. Couldn't resolve the following error
0 info it worked if it ends with ok 1 verbose cli [ 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Users\Bhargavii Nadendla\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'build' ] 2 info using [email protected] 3 info using [email protected] 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] 5 info lifecycle [email protected]~prebuild: [email protected] 6 info lifecycle [email protected]~build: [email protected] 7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true 8 verbose lifecycle [email protected]~build: PATH: C:\Users\Bhargavii Nadendla\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Bhargavii Nadendla\Desktop\Angular-Udemy\seed-project\node_modules.bin;C:\Users\Bhargavii Nadendla\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Bhargavii Nadendla\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_171\bin;C:\HashiCorp\Vagrant\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\nodejs;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Bhargavii Nadendla\Python\Scripts;C:\Users\Bhargavii Nadendla\Python;C:\Users\Bhargavii Nadendla\AppData\Local\Microsoft\WindowsApps;C:\Users\Bhargavii Nadendla\AppData\Local\GitHubDesktop\bin;C:\Users\Bhargavii Nadendla\AppData\Roaming\npm;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl 9 verbose lifecycle [email protected]~build: CWD: C:\Users\Bhargavii Nadendla\Desktop\Angular-Udemy\seed-project 10 silly lifecycle [email protected]~build: Args: [ '/d /s /c', 10 silly lifecycle 'del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch' ] 11 silly lifecycle [email protected]~build: Returned: code: 1 signal: null 12 info lifecycle [email protected]~build: Failed to exec build script 13 verbose stack Error: [email protected] build:
del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch
13 verbose stack Exit status 1 c 13 verbose stack at EventEmitter.emit (events.js:214:7) 13 verbose stack at ChildProcess. (C:\Users\Bhargavii Nadendla\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at emitTwo (events.js:126:13) 13 verbose stack at ChildProcess.emit (events.js:214:7) 13 verbose stack at maybeClose (internal/child_process.js:925:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 14 verbose pkgid [email protected] 15 verbose cwd C:\Users\Bhargavii Nadendla\Desktop\Angular-Udemy\seed-project 16 verbose Windows_NT 10.0.17134 17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\Bhargavii Nadendla\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "build" 18 verbose node v8.11.2 19 verbose npm v6.0.1 20 error code ELIFECYCLE 21 error errno 1 22 error [email protected] build:del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch
22 error Exit status 1 23 error Failed at the [email protected] build script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]
Here, I upload the package.json
{
"name": "udemy-nodejs-angular2",
"version": "1.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 'assets/app/**/*.js' 'assets/app/**/*.ngsummary.json' 'assets/app/**/*.ngstyle.*'"
},
"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/mon": "^5.0.0",
"@angular/piler": "^5.0.0",
"@angular/piler-cli": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/platform-server": "^5.0.0",
"@angular/router": "^5.0.0",
"@angular/upgrade": "^5.0.0",
"body-parser": "~1.15.2",
"cookie-parser": "~1.4.3",
"core-js": "^2.4.1",
"debug": "~2.2.0",
"express": "~4.14.0",
"hbs": "~3.1.0",
"mongoose": "^5.1.3",
"mongoose-unique-validator": "^2.0.1",
"morgan": "~1.6.1",
"reflect-metadata": "^0.1.3",
"rxjs": "^5.5.11",
"serve-favicon": "~2.3.0",
"zone.js": "^0.8.5"
},
"devDependencies": {
"@ngtools/webpack": "^1.8.0",
"@types/core-js": "0.9.36",
"@types/node": "^6.0.45",
"angular-router-loader": "^0.5.0",
"angular2-template-loader": "^0.5.0",
"awesome-typescript-loader": "^3.1.2",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"del-cli": "^0.2.0",
"html-loader": "^0.4.4",
"raw-loader": "^0.5.1",
"ts-loader": "^2.0.3",
"typescript": "^2.4.2",
"webpack": "^2.7.0",
"webpack-merge": "^4.1.0"
}
}
Error on npm run build. Updating the node-modules or clearing the cache didn't work. Updating the scripts even didn't work. Couldn't resolve the following error
0 info it worked if it ends with ok 1 verbose cli [ 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Users\Bhargavii Nadendla\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'build' ] 2 info using [email protected] 3 info using [email protected] 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] 5 info lifecycle [email protected]~prebuild: [email protected] 6 info lifecycle [email protected]~build: [email protected] 7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true 8 verbose lifecycle [email protected]~build: PATH: C:\Users\Bhargavii Nadendla\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Bhargavii Nadendla\Desktop\Angular-Udemy\seed-project\node_modules.bin;C:\Users\Bhargavii Nadendla\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Bhargavii Nadendla\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_171\bin;C:\HashiCorp\Vagrant\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\nodejs;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Bhargavii Nadendla\Python\Scripts;C:\Users\Bhargavii Nadendla\Python;C:\Users\Bhargavii Nadendla\AppData\Local\Microsoft\WindowsApps;C:\Users\Bhargavii Nadendla\AppData\Local\GitHubDesktop\bin;C:\Users\Bhargavii Nadendla\AppData\Roaming\npm;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl 9 verbose lifecycle [email protected]~build: CWD: C:\Users\Bhargavii Nadendla\Desktop\Angular-Udemy\seed-project 10 silly lifecycle [email protected]~build: Args: [ '/d /s /c', 10 silly lifecycle 'del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch' ] 11 silly lifecycle [email protected]~build: Returned: code: 1 signal: null 12 info lifecycle [email protected]~build: Failed to exec build script 13 verbose stack Error: [email protected] build:
del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch
13 verbose stack Exit status 1 c 13 verbose stack at EventEmitter.emit (events.js:214:7) 13 verbose stack at ChildProcess. (C:\Users\Bhargavii Nadendla\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at emitTwo (events.js:126:13) 13 verbose stack at ChildProcess.emit (events.js:214:7) 13 verbose stack at maybeClose (internal/child_process.js:925:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 14 verbose pkgid [email protected] 15 verbose cwd C:\Users\Bhargavii Nadendla\Desktop\Angular-Udemy\seed-project 16 verbose Windows_NT 10.0.17134 17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\Bhargavii Nadendla\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "build" 18 verbose node v8.11.2 19 verbose npm v6.0.1 20 error code ELIFECYCLE 21 error errno 1 22 error [email protected] build:del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch
22 error Exit status 1 23 error Failed at the [email protected] build script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]
Here, I upload the package.json
{
"name": "udemy-nodejs-angular2",
"version": "1.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 'assets/app/**/*.js' 'assets/app/**/*.ngsummary.json' 'assets/app/**/*.ngstyle.*'"
},
"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/mon": "^5.0.0",
"@angular/piler": "^5.0.0",
"@angular/piler-cli": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/platform-server": "^5.0.0",
"@angular/router": "^5.0.0",
"@angular/upgrade": "^5.0.0",
"body-parser": "~1.15.2",
"cookie-parser": "~1.4.3",
"core-js": "^2.4.1",
"debug": "~2.2.0",
"express": "~4.14.0",
"hbs": "~3.1.0",
"mongoose": "^5.1.3",
"mongoose-unique-validator": "^2.0.1",
"morgan": "~1.6.1",
"reflect-metadata": "^0.1.3",
"rxjs": "^5.5.11",
"serve-favicon": "~2.3.0",
"zone.js": "^0.8.5"
},
"devDependencies": {
"@ngtools/webpack": "^1.8.0",
"@types/core-js": "0.9.36",
"@types/node": "^6.0.45",
"angular-router-loader": "^0.5.0",
"angular2-template-loader": "^0.5.0",
"awesome-typescript-loader": "^3.1.2",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"del-cli": "^0.2.0",
"html-loader": "^0.4.4",
"raw-loader": "^0.5.1",
"ts-loader": "^2.0.3",
"typescript": "^2.4.2",
"webpack": "^2.7.0",
"webpack-merge": "^4.1.0"
}
}
Share
Improve this question
edited Jun 3, 2018 at 22:47
Melchia
24.4k23 gold badges108 silver badges129 bronze badges
asked Jun 3, 2018 at 21:30
user9718365user9718365
2
- try to install latest version of nodejs and angular-cli – Arash Commented Jun 3, 2018 at 21:44
- can you share with us package.json – Muhammed Albarmavi Commented Jun 3, 2018 at 21:51
1 Answer
Reset to default 3I've installed with ubuntu on your same package.json and it worked just fine.
I'm using node V8.11, npm 6.10;
It seems that you are using node 6.0 in your machine and node 8.0;
First, a good try is to update your npm to 6.10 and your node to a newer version, or just reinstall node. But it is more likely to be your user having no access to finish the build proccess as you can see in
`
14 verbose pkgid [email protected]
15 verbose cwd C:\Users\Bhargavii Nadendla\Desktop\Angular-Udemy\seed-project
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Bhargavii Nadendla\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v8.11.2
19 verbose npm v6.0.1
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: `del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch`
22 error Exit status 1
`
Whenever that happen i just run sudo on ubuntu and it is fixed. What are the permissions that your user have in the project folder node_modules
and essentially in "C:\\Users\\Bhargavii Nadendla\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js"
?
If it is not permission related, try out to install a newer version of node and point it out to C: removing it from AppData of windows, this can actually cause a access permission fail.