Related
This is the error code i keep receiving in my terminal of VSCode:
npm ERR! errno 1
npm ERR! discord-bot#1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the discord-bot#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache\_logs\2021-01-26T07_31_43_854Z-debug.log
PS D:\scripts>
I dont know whats wrong, i reinstalled NPM, didnt solve the problem, i removed "test" from my package.json and replaced the "start":node index.js with "start":node .
Before this error, i received the error that package.json wasnt in the main folder, which i resolved by copying my discord-bot script, my package.json, the modules and the package.lock to my main folder. since then i kept getting this error
this is my discord-bot code right now.
const discord = require("discord.js");
const client = new discord.Client();
client.on("ready", () => {
console.log("We have logged in for the first time!!");
});
client.on("message", (msg) => {
if (msg.content.startsWith("/av")) {
var embed = new discord.MessageEmbed();
embed.color = 0xf01000;
embed.setImage(msg.author.displayAvatarURL());
embed.description = "Coole avatar pik";
msg.channel.send(embed);
}
});
client.on("npge", (msg) => {
if (msg.author.bot) {
return
}
if (msg.content.startsWith("hello")) {
msg.channel.send("hello!");
}
})
client.on("guildMemberAdd", (member) => {
console.log("member joined");
member.roles.add(
"803273046454566918"
)
})
client.on("message", (msg) => {
if (fromID === me && text.includes("/repeat") ) {
bot.sendMessage({ to: channel, message: txt.replace('/repeat ','') });
}
})
client.login("TOKEN")
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm#6.14.10
3 info using node#v14.15.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle discord-bot#1.0.0~prestart: discord-bot#1.0.0
6 info lifecycle discord-bot#1.0.0~start: discord-bot#1.0.0
7 verbose lifecycle discord-bot#1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle discord-bot#1.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\scripts\node_modules\.bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;E:\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Users\James Kok\AppData\Local\Microsoft\WindowsApps;C:\Users\James Kok\AppData\Local\Yarn\bin;;D:\Users\James Kok\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\James Kok\AppData\Roaming\npm
9 verbose lifecycle discord-bot#1.0.0~start: CWD: D:\scripts
10 silly lifecycle discord-bot#1.0.0~start: Args: [ '/d /s /c', 'node index.js' ]
11 silly lifecycle discord-bot#1.0.0~start: Returned: code: 1 signal: null
12 info lifecycle discord-bot#1.0.0~start: Failed to exec start script
13 verbose stack Error: discord-bot#1.0.0 start: `node index.js`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid discord-bot#1.0.0
15 verbose cwd D:\scripts
16 verbose Windows_NT 10.0.19041
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start"
18 verbose node v14.15.4
19 verbose npm v6.14.10
20 error code ELIFECYCLE
21 error errno 1
22 error discord-bot#1.0.0 start: `node index.js`
22 error Exit status 1
23 error Failed at the discord-bot#1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
this is my package.json
{
"name": "discord-bot",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"discord.js": "^12.5.1"
}
}
and this is my package-lock.json
{
"name": "discord-bot",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"#discordjs/collection": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/#discordjs/collection/-/collection-0.1.6.tgz",
"integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ=="
},
"#discordjs/form-data": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/#discordjs/form-data/-/form-data-3.0.1.tgz",
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
}
},
"abort-controller": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
"requires": {
"event-target-shim": "^5.0.0"
}
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"requires": {
"delayed-stream": "~1.0.0"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
},
"discord.js": {
"version": "12.5.1",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.1.tgz",
"integrity": "sha512-VwZkVaUAIOB9mKdca0I5MefPMTQJTNg0qdgi1huF3iwsFwJ0L5s/Y69AQe+iPmjuV6j9rtKoG0Ta0n9vgEIL6w==",
"requires": {
"#discordjs/collection": "^0.1.6",
"#discordjs/form-data": "^3.0.1",
"abort-controller": "^3.0.0",
"node-fetch": "^2.6.1",
"prism-media": "^1.2.2",
"setimmediate": "^1.0.5",
"tweetnacl": "^1.0.3",
"ws": "^7.3.1"
}
},
"event-target-shim": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
},
"mime-db": {
"version": "1.45.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz",
"integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w=="
},
"mime-types": {
"version": "2.1.28",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz",
"integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==",
"requires": {
"mime-db": "1.45.0"
}
},
"node-fetch": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
},
"prism-media": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.3.tgz",
"integrity": "sha512-fSrR66n0l6roW9Rx4rSLMyTPTjRTiXy5RVqDOurACQ6si1rKHHKDU5gwBJoCsIV0R3o9gi+K50akl/qyw1C74A=="
},
"setimmediate": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
},
"tweetnacl": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
},
"ws": {
"version": "7.4.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz",
"integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA=="
}
}
}
Looks like your looking at the wrong error.
You called a variable named fromID I'm guessing you mean the author id, which can be called with
if (msg.author.id !== client.user.id && ..)
Our Jenkins job fails since the update to Angular 9. Everything works from the command line when logged in at the build server as the builduser. It also works on other devices in the command line.
But when the Jenkins job runs, the script ng build --prodfails
The error message is:
[33mWarning:[0m Entry point 'devextreme-angular/ui/vector-map' contains deep imports into 'C:/Users/builduser/.jenkins/workspace/my_project-Angular9/node_modules/devextreme/viz/vector_map', 'C:/Users/builduser/.jenkins/workspace/my_project-Angular9/node_modules/devextreme/bundles/dx.all'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
npm info lifecycle my_project#1.0.30~build: Failed to exec build script
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! my_project#1.0.30 build: `ng build --prod`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the my_project#1.0.30 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm timing npm Completed in 161871ms
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\builduser\AppData\Roaming\npm-cache\_logs\2020-04-14T15_05_03_975Z-debug.log
The Devextreme warnings at the beginning also appear on the successfull builds on our local machines, so I'm not sure if this is really a problem or if they can be ignored.
NodeJS version is 12.16.1 and NPM version is 6.13.4 on all machines.
The complete log mentioned mentioned above:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Users\\builduser\\.jenkins\\tools\\jenkins.plugins.nodejs.tools.NodeJSInstallation\\node12\\node.exe',
1 verbose cli 'C:\\Users\\builduser\\.jenkins\\tools\\jenkins.plugins.nodejs.tools.NodeJSInstallation\\node12\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using npm#6.13.4
3 info using node#v12.16.1
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle my_project#1.0.30~prebuild: my_project#1.0.30
6 info lifecycle my_project#1.0.30~build: my_project#1.0.30
7 verbose lifecycle my_project#1.0.30~build: unsafe-perm in lifecycle true
8 verbose lifecycle my_project#1.0.30~build: PATH: C:\Users\builduser\.jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\node12\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\builduser\.jenkins\workspace\my_project-Angular9\node_modules\.bin;C:\Users\builduser\.jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\node12;C:\Users\builduser\.jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\node12;C:\Bitnami\rubystack-2.4.5-7\ImageMagick-7.0.8-Q16;C:\Program Files (x86)\Windows Resource Kits\Tools\;C:\Program Files (x86)\PHP\v5.4;C:\Windows\system32\inetsrv;C:\Program Files (x86)\PHP\v7.0;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\ProgramData\chocolatey\bin;C:\Program Files\Java\jdk1.8.0_162\bin;C:\Users\alisakarolina.becker\AppData\Local\Microsoft\WindowsApps;C:\Python27;C:\Users\builduser\gradle\wrapper\dists\gradle-4.5-bin\36tjdrrafkua0yehaomoqzk6f\gradle-4.5\bin;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Qt\Tools\QtCreator\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Gpg4win\..\GnuPG\bin;C:\Program Files\doxygen\bin;C:\Maven\apache-maven-3.6.1\bin;C:\Program Files\PostgreSQL\12\bin;C:\Tools\sonar-scanner-4.2.0.1873-windows\bin;C:\Program Files\nodejs\;C:\Users\builduser\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\builduser\Documents\gradle\gradle-4.5\bin;C:\Tools\CppDepend;C:\Program Files\Cppcheck;C:\Tools\Process Explorer
9 verbose lifecycle my_project#1.0.30~build: CWD: C:\Users\builduser\.jenkins\workspace\my_project-Angular9
10 silly lifecycle my_project#1.0.30~build: Args: [ '/d /s /c', 'ng build --prod' ]
11 silly lifecycle my_project#1.0.30~build: Returned: code: 134 signal: null
12 info lifecycle my_project#1.0.30~build: Failed to exec build script
13 verbose stack Error: my_project#1.0.30 build: `ng build --prod`
13 verbose stack Exit status 134
13 verbose stack at EventEmitter.<anonymous> (C:\Users\builduser\.jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\node12\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:311:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\builduser\.jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\node12\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:311:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid my_project#1.0.30
15 verbose cwd C:\Users\builduser\.jenkins\workspace\my_project-Angular9
16 verbose Windows_NT 10.0.14393
17 verbose argv "C:\\Users\\builduser\\.jenkins\\tools\\jenkins.plugins.nodejs.tools.NodeJSInstallation\\node12\\node.exe" "C:\\Users\\builduser\\.jenkins\\tools\\jenkins.plugins.nodejs.tools.NodeJSInstallation\\node12\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v12.16.1
19 verbose npm v6.13.4
20 error code ELIFECYCLE
21 error errno 134
22 error my_project#1.0.30 build: `ng build --prod`
22 error Exit status 134
23 error Failed at the my_project#1.0.30 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 134, true ]
The Jenkinsfile:
pipeline {
agent any
tools {nodejs "node12"}
stages {
stage('install dependencies') {
steps {
bat 'npm install --no-save'
}
}
stage('build version') {
steps {
bat "npm run build"
}
}
}
Package.json:
{
"name": "my_project",
"version": "1.0.30",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod"
},
"dependencies": {
"#angular/animations": "^9.1.1",
"#angular/cdk": "^9.2.0",
"#angular/common": "^9.1.1",
"#angular/compiler": "^9.1.1",
"#angular/core": "^9.1.1",
"#angular/elements": "^9.1.1",
"#angular/forms": "^9.1.1",
"#angular/material": "^9.2.0",
"#angular/platform-browser": "^9.1.1",
"#angular/platform-browser-dynamic": "^9.1.1",
"#angular/router": "^9.1.1",
"#angular/upgrade": "^9.1.1",
"compass-mixins": "^0.12.10",
"core-js": "^3.6.4",
"dateformat": "^3.0.2",
"devextreme": "^19.2.7",
"devextreme-angular": "^19.2.7",
"devextreme-intl": "^19.1.8",
"in-view": "^0.6.1",
"jquery": "^3.4.1",
"lodash": "^4.17.15",
"muuri": "0.8.0",
"ng2-nouislider": "^1.8.2",
"nouislider": "^14.1.1",
"reflect-metadata": "^0.1.13",
"rxjs": "6.5.5",
"tslib": "^1.11.1",
"zone.js": "~0.10.3"
},
"devDependencies": {
"#angular-devkit/build-angular": "~0.901.1",
"#angular/cli": "^9.1.1",
"#angular/compiler-cli": "9.1.1",
"#angular/language-service": "^9.1.1",
"#angular/platform-server": "9.1.1",
"#types/dateformat": "^3.0.1",
"#types/jasmine": "^3.5.9",
"#types/jasminewd2": "~2.0.6",
"#types/jquery": "^3.3.33",
"#types/node": "^13.9.1",
"#types/selenium-webdriver": "^4.0.9",
"clang-format": "^1.0.32",
"css-loader": "^3.2.0",
"cypress": "^3.8.3",
"del": "^5.1.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "^5.1.0",
"fs-extra": "^8.1.0",
"html-loader": "^0.5.1",
"html-webpack-plugin": "^3.2.0",
"jasmine-core": "^3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.4.1",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "^2.0.1",
"karma-coverage-istanbul-reporter": "^2.1.0",
"karma-jasmine": "^3.1.1",
"karma-jasmine-html-reporter": "^1.4.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-typescript": "^4.1.1",
"lodash.throttle": "^4.1.1",
"ng-annotate-webpack-plugin": "^0.3.0",
"ng-focus-if": "^1.0.7",
"node-sass": "^4.12.0",
"node-sass-json-importer": "^4.1.2",
"pre-commit": "^1.2.2",
"properties-loader": "0.0.1",
"protractor": "^5.4.2",
"sass-loader": "^8.0.2",
"script-loader": "^0.7.2",
"source-map-loader": "^0.2.1",
"style-loader": "^0.21.0",
"ts-loader": "^6.2.1",
"ts-node": "^8.0.0",
"tslint": "^6.1.0",
"typescript": "~3.7.5",
"watch": "^1.0.2",
"webpack-bundle-analyzer": "^3.6.1"
}
}
The "build" script works if the "--prod" parameter is removed
angular.json:
{
"$schema": "./node_modules/#angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"my_project": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "rc",
"schematics": {
"#schematics/angular:component": {
"style": "scss"
}
},
"architect": {
"build": {
"builder": "#angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "dist/my_project",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "8mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
]
}
}
},
"serve": {
"builder": "#angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "my_project:build",
"aot": true
},
"configurations": {
"production": {
"browserTarget": "my_project:build:production"
}
}
},
"extract-i18n": {
"builder": "#angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "my_project:build"
}
},
"test": {
"builder": "#angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.ts",
"styles": [
"src/styles.scss"
],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
}
},
"lint": {
"builder": "#angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
},
"defaultProject": "my_project"
}
Has anybody some idea what the reason of this error could be?
I'm trying to run Ganache in WSL (Ubuntu). When I clone git repository, npm install and then run npm start, I get this error which is not specified.
> ganache#2.0.0-beta.1 start /mnt/c/Users/Name/Documents/ethereum_projects/Ganache/ganache
> electron-forge start
✔ Checking your system
✔ Locating Application
✔ Preparing native dependencies: 15 / 15
✔ Launching Application
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ganache#2.0.0-beta.1 start: `electron-forge start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ganache#2.0.0-beta.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/name/.npm/_logs/2018-12-25T22_53_48_231Z-debug.log
In the log file is nothing more specific. Here is it:
10 silly lifecycle ganache#2.0.0-beta.1~start: Args: [ '-c', 'electron-forge start' ]
11 silly lifecycle ganache#2.0.0-beta.1~start: Returned: code: 1 signal: null
12 info lifecycle ganache#2.0.0-beta.1~start: Failed to exec start script
13 verbose stack Error: ganache#2.0.0-beta.1 start: `electron-forge start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:962:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid ganache#2.0.0-beta.1
15 verbose cwd /mnt/c/Users/Name/Documents/ethereum_projects/Ganache/ganache
16 verbose Linux 4.4.0-17763-Microsoft
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v10.14.2
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error ganache#2.0.0-beta.1 start: `electron-forge start`
22 error Exit status 1
23 error Failed at the ganache#2.0.0-beta.1 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
and here is my package.json:
{
"name": "ganache",
"productName": "Ganache",
"version": "2.0.0-beta.1",
"description": "Personal Blockchain for Ethereum",
"main": "./src/init.js",
"private": true,
"scripts": {
"start": "electron-forge start",
"lint": "echo \"No linting configured\"",
"sign-mac": "codesign --deep --force --verbose --sign 'Developer ID Application: Timothy Coulter (58RKXWC272)' ./dist/*.dmg",
"makeappxassets": "svg2uwptiles -i ./Logo.svg -c ./blank.svg -o ./resources/appx/",
"build-linux": "cd ./node_modules/rabin-bindings && node-gyp rebuild && cd ../../ && electron-builder --linux",
"build-mac": "electron-builder --mac",
"build-windows": "electron-builder --win",
"test": "npm run test-mocha",
"test-mocha": "mocha --compilers js:babel-register --check-leaks --globals _scratch,sanitizedData 'test/mocha/**/*.test.js'"
},
"browserslist": "chrome 50",
"build": {
"appId": "org.trufflesuite.ganache",
"files": [
"src/**/*",
"node_modules/**/*",
"resources/fonts/*",
"resources/icons/**/*",
"package.json"
],
"directories": {
"buildResources": "resources",
"output": "dist"
},
"win": {
"icon": "resources/icons/win/icon.ico",
"certificateFile": "./certs/cert.pfx",
"target": [
{
"target": "nsis",
"arch": [
"x64"
]
},
{
"target": "appx",
"arch": [
"x64"
]
}
]
},
"appx": {
"identityName": "Ganache",
"publisher": "CN=Consensys Inc, O=Consensys Inc, L=New York, S=New York, C=US",
"publisherDisplayName": "Consensys Inc",
"backgroundColor": "#34262A"
},
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": "true",
"deleteAppDataOnUninstall": "true",
"artifactName": "Ganache-${version}-setup.${ext}"
},
"mac": {
"icon": "resources/icons/icon.icns",
"identity": "Timothy Coulter (58RKXWC272)"
},
"dmg": {
"background": "resources/dmg/background.tiff",
"contents": [
{
"x": 219,
"y": 358,
"type": "dir",
"name": "Ganache.app"
},
{
"x": 439,
"y": 358,
"type": "link",
"name": "Applications",
"path": "/Applications"
}
],
"icon": "resources/icons/icon.icns",
"format": "ULFO"
},
"linux": {
"target": [
{
"target": "AppImage",
"arch": [
"x64"
]
}
],
"icon": "resources/icons/png/",
"category": "Development",
"executableName": "Ganache",
"artifactName": "Ganache-${version}.${ext}"
}
},
"config": {
"forge": {
"electronPackagerConfig": {
"icon": "resources/icons/win/icon.ico",
"prune": true,
"ignore": [
".*node_modules/fsevents/build.*",
"forge_hooks",
".vscode"
],
"afterPrune": [
"./forge_hooks/afterPrune.js"
]
}
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/trufflesuite/ganache.git"
},
"author": {
"name": "Truffle",
"email": "inquiry#trufflesuite.com",
"url": "https://github.com/trufflesuite"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/trufflesuite/ganache/issues"
},
"keywords": [
"ganache",
"ethereum",
"blockchain",
"truffle"
],
"homepage": "https://github.com/trufflesuite/ganache#readme",
"devDependencies": {
"asar": "^0.13.0",
"babel-core": "^6.21.0",
"babel-eslint": "^7.1.1",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-inline-react-svg": "^0.5.2",
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-plugin-transform-class-properties": "^6.19.0",
"babel-plugin-transform-es2015-classes": "^6.18.0",
"babel-polyfill": "^6.20.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"babel-preset-react-hmre": "^1.1.1",
"babel-preset-react-optimize": "^1.0.1",
"babel-preset-stage-0": "^6.16.0",
"chai": "^3.5.0",
"concurrently": "^3.1.0",
"cross-env": "^3.1.4",
"electron-builder": "20.31.2",
"electron-compilers": "^5.9.0",
"electron-debug": "^1.1.0",
"electron-devtools-installer": "^2.0.1",
"electron-forge": "^5.1.1",
"electron-icon-maker": "0.0.3",
"electron-log": "^2.2.9",
"electron-prebuilt-compile": "1.8.4",
"jsdom": "^9.9.1",
"minimist": "^1.2.0",
"mocha": "^3.5.3",
"node-sass": "^4.5.3",
"prop-types": "^15.5.10",
"rcedit": "^0.9.0",
"redux-logger": "^2.7.4",
"source-map-support": "^0.4.8",
"svg2uwptiles": "0.0.4",
"temp": "^0.8.3",
"webpack": "^3.11.0"
},
"dependencies": {
"#exponent/electron-cookies": "^2.0.0",
"#seesemichaelj/react-json-view": "^1.20.2",
"async": "^2.5.0",
"benjamincburns-forked-electron-updater": "2.21.6",
"builder-util-runtime": "^4.2.0",
"electron-compile": "^6.4.2",
"electron-settings": "^3.1.2",
"electron-squirrel-startup": "^1.0.0",
"ethagen": "0.0.2",
"ethereumjs-units": "^0.2.0",
"filesize": "^3.6.1",
"find-process": "^1.1.0",
"fs-extra": "^7.0.0",
"ganache-core": "2.3.2",
"keccak": "^1.4.0",
"lodash.clonedeep": "^4.5.0",
"lodash.isequal": "^4.5.0",
"lodash.merge": "^4.6.1",
"lodash.omit": "^4.5.0",
"lodash.padstart": "^4.6.1",
"moment": "^2.17.1",
"moment-timezone": "^0.5.11",
"moniker": "^0.1.2",
"mousetrap": "^1.6.1",
"node-localstorage": "^1.3.1",
"pidusage": "^1.1.5",
"pluralize": "^5.0.0",
"rabin-bindings": "^1.7.4",
"react": "^16.3.2",
"react-custom-scrollbars": "^4.2.1",
"react-dom": "^16.3.2",
"react-hot-loader": "^3.1.1",
"react-marked-markdown": "^1.4.6",
"react-md-spinner": "^0.3.0",
"react-moment": "^0.2.2",
"react-redux": "^5.0.2",
"react-render-html": "^0.6.0",
"react-router": "^3.0.1",
"react-router-redux": "^4.0.7",
"redux": "^3.6.0",
"redux-thunk": "^2.2.0",
"reselect": "^2.5.4",
"rlp": "^2.1.0",
"scrypt": "^6.0.3",
"truffle-config": "^1.1.0-next.1",
"truffle-decoder": "^1.0.1-beta.0",
"universal-analytics": "^0.4.13",
"uuid": "^3.1.0",
"web3": "1.0.0-beta.35"
},
"optionalDependencies": {
"7zip-bin-win": "^2.2.0",
"dmg-builder": "^5.3.0"
},
"devEngines": {
"node": ">=6.x",
"npm": ">=3.x"
}
}
fdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfa
fdfsfasdfa
I cloned Ganache and followed all the instructions on the Readme.md file, everything went fine for me. I am using:
Node : v9.11.1
npm : 6.4.1
I will suggest you delete your node_modules then you should carefully go through the instructions and also ensure you're following their basic requirements:
npm v5.3.0
node v8.3.0
After which you can then go ahead and do these:
npm install
npm start
NOTE: Ensure that all your dependencies are successfully installed when you run npm install
I'm struggling badly with this issue, facing below error and not able to find out why its happening. With same package.json I'm able to run my application on macbook but when I'm trying to install/deploy same application on Ubuntu for the Production on aws ec2 instance using npm start --prod. I'm facing below error.
Environment details are as following.
Ubuntu Version:- 18.04 LTS (GNU/Linux 4.15.0-1007-aws x86_64)
NPM -v : - 6.4.1
NODE -v : - v10.10.0
Error:-
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using npm#6.4.1
3 info using node#v10.10.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle myPleaks#0.0.0prestart: myPleaks#0.0.0
6 info lifecycle myPleaks#0.0.0start: myPleaks#0.0.0
7 verbose lifecycle myPleaks#0.0.0start: unsafe-perm in lifecycle true
8 verbose lifecycle myPleaks#0.0.0start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/ubuntu/mypleaks-ui/myPleaks/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle myPleaks#0.0.0start: CWD: /home/ubuntu/mypleaks-ui/myPleaks
10 silly lifecycle myPleaks#0.0.0start: Args: [ '-c', 'ng serve' ]
11 silly lifecycle myPleaks#0.0.0start: Returned: code: 137 signal: null
12 info lifecycle myPleaks#0.0.0start: Failed to exec start script
13 verbose stack Error: myPleaks#0.0.0 start: ng serve
13 verbose stack Exit status 137
13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:962:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid myPleaks#0.0.0
15 verbose cwd /home/ubuntu/mypleaks-ui/myPleaks
16 verbose Linux 4.15.0-1007-aws
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v10.10.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 137
22 error myPleaks#0.0.0 start: ng serve
22 error Exit status 137
23 error Failed at the myPleaks#0.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 137, true ]
package.json
{
"name": "myPleaks",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "^6.0.3",
"#angular/common": "^6.0.3",
"#angular/compiler": "^6.0.3",
"#angular/core": "^6.0.3",
"#angular/forms": "^6.0.3",
"#angular/http": "^6.0.3",
"#angular/platform-browser": "^6.0.3",
"#angular/platform-browser-dynamic": "^6.0.3",
"#angular/router": "^6.0.3",
"#ng-select/ng-select": "^2.0.2",
"#ng-bootstrap/ng-bootstrap": "^1.1.2",
"#swimlane/ngx-datatable": "^13.0.0",
"#swimlane/ngx-charts": "^8.1.0",
"angular-calendar": "^0.22.1",
"bootstrap": "^4.1.1",
"chart.js": "^2.7.1",
"chartist": "^0.11.0",
"core-js": "^2.4.1",
"jasmine": "^3.1.0",
"jquery": "^3.2.1",
"jquery-slimscroll": "^1.3.8",
"ng2-charts": "^1.6.0",
"ngx-bootstrap": "^2.0.5",
"ngx-uploader": "^6.0.1",
"ng2-dragula": "^1.5.0",
"ng2-file-upload": "^1.3.0",
"ngx-quill": "^3.1.0",
"pace-js": "^1.0.2",
"popper.js": "^1.12.5",
"rxjs": "^6.2.0",
"zone.js": "^0.8.4",
"rxjs-compat": "^6.0.0-rc.0",
"auth0-js": "^9.3.3",
"aws-sdk": "^2.233.1",
"ng2-datepicker": "^3.1.0"
},
"devDependencies": {
"#angular-devkit/build-angular": "~0.6.5",
"#angular/cli": "^6.1.5",
"#angular/compiler-cli": "^6.0.3",
"#angular/language-service": "^6.0.3",
"#types/chartist": "^0.9.37",
"#types/jasmine": "~2.5.53",
"#types/jasminewd2": "~2.0.2",
"#types/jquery": "^3.2.5",
"#types/node": "~6.0.60",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "^2.7.2"
}}
angular.json
{
"$schema": "./node_modules/#angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"myPleaks": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "#angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/favicon.ico"
],
"styles": [
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"./node_modules/#ng-select/ng-select/themes/default.theme.css",
"src/styles.css",
"src/assets/scss/style.scss"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/pace-js/pace.min.js"
]
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "#angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "myPleaks:build",
"port": 8080
},
"configurations": {
"production": {
"browserTarget": "myPleaks:build:production"
}
}
},
"extract-i18n": {
"builder": "#angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "myPleaks:build"
}
},
"test": {
"builder": "#angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/pace-js/pace.min.js"
],
"styles": [
"src/styles.css",
"src/assets/scss/style.scss"
],
"assets": [
"src/assets",
"src/favicon.ico"
]
}
},
"lint": {
"builder": "#angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"myPleaks-e2e": {
"root": "",
"sourceRoot": "",
"projectType": "application",
"architect": {
"e2e": {
"builder": "#angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "myPleaks:serve"
}
},
"lint": {
"builder": "#angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "myPleaks",
"schematics": {
"#schematics/angular:component": {
"prefix": "app",
"styleext": "css"
},
"#schematics/angular:directive": {
"prefix": "app"
}
}}
I'm building my first website and started with a react template from someone else. To develop locally on my Windows computer I used "npm start" which was fine. Now I'm trying to deploy on my Linux machine but I'm just getting a white page and my react js files are not loading.
I'm now trying with "npm run build" which is launching the production config (which I didn't write) and it's throwing an error I can't figure out. Below is all the relevant info I have. Does anyone have ANY idea what it could be? I've wasted hours and hours trying to figure this out.
I tried updating npm, reinstalling node modules, using admin mode and so on. The problem happens on both my windows and Linux machine when using "npm run build".
Any suggestions, please?
Command line error on LINUX
ERROR in bundle2.js from UglifyJs
Invalid assignment [bundle2.js:15571,30]
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js?sourceMap&localIdentName=[local]___[hash:base64:5]!node_modules/sass-loader/lib/loader.js?outputStyle=expanded!app/styles/index.scss:
[0] ./node_modules/css-loader?sourceMap&localIdentName=[local]___[hash:base64:5]!./node_modules/sass-loader/lib/loader.js?outputStyle=expanded!./app/styles/index.scss 2.86 kB {0} [built]
factory:13ms building:8255ms = 8268ms
+ 1 hidden module
npm ERR! Linux 2.6.32-696.23.1.el6.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
npm ERR! node v6.14.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! cb-react-redux#0.1.0 build: `webpack --config webpack.production.config.js --progress --profile --colors`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the cb-react-redux#0.1.0 build script 'webpack --config webpack.production.config.js --progress --profile --colors'.
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 cb-react-redux package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack --config webpack.production.config.js --progress --profile --colors
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs cb-react-redux
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls cb-react-redux
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/psmet/piettest/npm-debug.log
Debug log file from WINDOWS
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli
'C:\\Users\\psmet\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-
cli.js',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using npm#6.1.0
3 info using node#v8.9.4
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle cb-react-redux#0.1.0~prebuild: cb-react-redux#0.1.0
6 info lifecycle cb-react-redux#0.1.0~build: cb-react-redux#0.1.0
7 verbose lifecycle cb-react-redux#0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle cb-react-redux#0.1.0~build: PATH:
C:\Users\psmet\AppData\Roaming\npm\node_modules\npm\node_modules\npm-
lifecycle\node-gyp-bin;C:\Users\psmet\Documents\GUI\trackingcodes\node_modules\.bin;c:\oracle\product\11.2.0\client_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\SysWow64;C:\Users\psmet\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Perforce;C:\Program Files\nodejs\;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Users\psmet\AppData\Local\Programs\Python\Python36\Scripts\;C:\Users\psmet\AppData\Local\Programs\Python\Python36\;C:\Users\psmet\AppData\Roaming\npm
9 verbose lifecycle cb-react-redux#0.1.0~build: CWD: C:\Users\psmet\Documents\GUI\trackingcodes
10 silly lifecycle cb-react-redux#0.1.0~build: Args: [ '/d /s /c',
10 silly lifecycle 'webpack --config webpack.production.config.js --progress --profile --colors' ]
11 silly lifecycle cb-react-redux#0.1.0~build: Returned: code: 2 signal: null
12 info lifecycle cb-react-redux#0.1.0~build: Failed to exec build script
13 verbose stack Error: cb-react-redux#0.1.0 build: `webpack --config webpack.production.config.js --progress --profile --colors`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (C:\Users\psmet\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\psmet\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 cb-react-redux#0.1.0
15 verbose cwd C:\Users\psmet\Documents\GUI\trackingcodes
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\psmet\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v8.9.4
19 verbose npm v6.1.0
20 error code ELIFECYCLE
21 error errno 2
22 error cb-react-redux#0.1.0 build: `webpack --config webpack.production.config.js --progress --profile --colors`
webpack.production.config.js (both linux/windows)
var webpack = require('webpack');
var path = require('path');
var loaders = require('./webpack.loaders');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var WebpackCleanupPlugin = require('webpack-cleanup-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
loaders.push({
test: /\.scss$/,
loader: ExtractTextPlugin.extract({fallback: 'style-loader', use : 'css-loader?sourceMap&localIdentName=[local]___[hash:base64:5]!sass-loader?outputStyle=expanded'}),
exclude: ['node_modules']
});
module.exports = {
entry: [
'./app/src/index.jsx',
'./app/styles/index.scss'
],
output: {
publicPath: './',
path: path.join(__dirname, 'public'),
filename: 'bundle2.js'
},
resolve: {
extensions: ['.js', '.jsx']
},
module: {
loaders
},
plugins: [
new WebpackCleanupPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
screw_ie8: true,
drop_console: true,
drop_debugger: true
}
}),
new webpack.optimize.OccurrenceOrderPlugin(),
new ExtractTextPlugin({
filename: 'style.css',
allChunks: true
}),
]
};
package.json (both win/linux)
{
"name": "cb-react-redux",
"version": "0.1.0",
"description": "React Webpack Babel Starter Kit",
"main": "''",
"scripts": {
"build": "webpack --config webpack.production.config.js --progress --profile --colors",
"start": "webpack-dev-server --progress --profile --colors",
"lint": "eslint --ext js --ext jsx app || exit 0",
"prod": "node server.js",
"dev": " webpack-dashboard -- webpack-dev-server",
"test": "export NODE_ENV=test && jest"
},
"repository": {
"type": "git",
"url": "https://github.com/alicoding/react-webpack-babel"
},
"author": "Rick Ekins",
"license": "MIT",
"homepage": "https://github.com/alicoding/react-webpack-babel#readme",
"dependencies": {
"axios": "^0.18.0",
"body-parser": "^1.18.2",
"ejs": "^2.5.7",
"express": "^4.16.2",
"http": "0.0.0",
"material-ui": "^0.19.4",
"mysql": "^2.15.0",
"node-sass": "^4.7.2",
"normalize.css": "^7.0.0",
"npm": "^6.1.0",
"query-string": "^6.1.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-ga": "^2.4.1",
"reactstrap": "^5.0.0-alpha.4",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0",
"sass-loader": "^6.0.6",
"serve-favicon": "^2.4.5",
"serve-static": "^1.13.1"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-jest": "^21.2.0",
"babel-loader": "^7.1.2",
"babel-plugin-module-resolver": "^3.0.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"babel-runtime": "^6.26.0",
"css-loader": "^0.28.10",
"enzyme": "^3.2.0",
"enzyme-adapter-react-16": "^1.1.0",
"eslint": "^4.11.0",
"eslint-plugin-jest": "^21.3.2",
"eslint-plugin-react": "^7.5.1",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.5",
"html-webpack-plugin": "^2.30.1",
"jest": "^21.2.1",
"loglevel": "^1.6.0",
"postcss-loader": "^2.0.8",
"react-hot-loader": "^3.1.3",
"react-router-dom": "^4.2.2",
"react-router-redux": "^4.0.8",
"react-test-renderer": "*",
"style-loader": "^0.19.0",
"url-loader": "^0.6.2",
"webpack": "^3.8.1",
"webpack-cleanup-plugin": "^0.5.1",
"webpack-dashboard": "^1.0.2",
"webpack-dev-server": "^2.9.4"
},
"jest": {
"verbose": true,
"bail": true,
"collectCoverage": true,
"coverageDirectory": "coverage",
"moduleNameMapper": {
"\\.(jpe?g|png|gif|eot|otf|webp|svg|ttf|woff2?|mp[34]|webm|wav|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
"\\.(css|less|s[ac]ss|styl)$": "<rootDir>/__mocks__/styleMock.js"
},
"moduleFileExtensions": [
"js",
"jsx"
],
"moduleDirectories": [
"node_modules"
]
}
}
And here is my webpack.config.js (both win/linux)
"use strict";
var webpack = require('webpack');
var path = require('path');
var loaders = require('./webpack.loaders');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var DashboardPlugin = require('webpack-dashboard/plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
const HOST = process.env.HOST || "127.0.0.1";
const PORT = process.env.PORT || "8888";
loaders.push({
test: /\.scss$/,
loaders: ['style-loader', 'css-loader?importLoaders=1', 'sass-loader'],
exclude: ['node_modules']
});
module.exports = {
entry: [
'react-hot-loader/patch',
'./app/src/index.jsx', // your app's entry point
],
devtool: process.env.WEBPACK_DEVTOOL || 'eval-source-map',
output: {
publicPath: '/',
path: path.join(__dirname, 'public'),
filename: 'bundle.js'
},
resolve: {
extensions: ['.js', '.jsx']
},
module: {
loaders
},
devServer: {
contentBase: "./public",
// do not print bundle build stats
noInfo: true,
// enable HMR
hot: true,
// embed the webpack-dev-server runtime into the bundle
inline: true,
// serve index.html in place of 404 responses to allow HTML5 history
historyApiFallback: true,
port: PORT,
host: HOST
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin(),
new ExtractTextPlugin({
filename: 'style.css',
allChunks: true
}),
new DashboardPlugin(),
new HtmlWebpackPlugin({
template: './app/src/template.html',
files: {
css: ['style.css'],
js: [ "bundle.js"],
}
}),
]
};