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?
Related
I'm building a project based off the Electron React Boilerplate project. I am running MacOS 10.15.7 and node v14.15.1.
I'm trying to install sqlite3 package. Since it's a native dependency, I ran yarn add sqlite3 inside the src/ directory, like it says to do here. The compilation fails with the following output:
henryoconnor#Henrys-MacBook-Pro-5 src % yarn add sqlite3
yarn add v1.22.10
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ sqlite3#5.0.2
info All dependencies
└─ sqlite3#5.0.2
$ yarn electron-rebuild
yarn run v1.22.10
$ node -r ../.erb/scripts/BabelRegister.js ../.erb/scripts/ElectronRebuild.js
⠴ Building modules: 0/1gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
⠦ Building modules: 0/1gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args '/Users/henryoconnor/Documents/secretary/electron-app/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/sqlite3/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/henryoconnor/Documents/secretary/electron-app/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/henryoconnor/.electron-gyp/11.3.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/henryoconnor/.electron-gyp/11.3.0',
gyp info spawn args '-Dnode_gyp_dir=/Users/henryoconnor/Documents/secretary/electron-app/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/henryoconnor/.electron-gyp/11.3.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/sqlite3',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
⠸ Building modules: 0/1No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
⠴ Building modules: 0/1gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
⠧ Building modules: 0/1 LIBTOOL-STATIC Release/nothing.a
⠋ Building modules: 0/1 ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c
⠼ Building modules: 0/1 TOUCH Release/obj.target/deps/action_before_build.stamp
⠴ Building modules: 0/1 CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3340000/sqlite3.o
⠸ Building modules: 0/1 LIBTOOL-STATIC Release/sqlite3.a
⠴ Building modules: 0/1 CXX(target) Release/obj.target/node_sqlite3/src/backup.o
⠹ Building modules: 0/1In file included from ../src/backup.cc:2:
In file included from /Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/node-addon-api/napi.h:2636:
/Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/node-addon-api/napi-inl.h:1575:24: error: use of undeclared
identifier 'napi_is_detached_arraybuffer'; did you mean 'napi_is_arraybuffer'?
napi_status status = napi_is_detached_arraybuffer(_env, _value, &detached);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
napi_is_arraybuffer
/Users/henryoconnor/.electron-gyp/11.3.0/include/node/js_native_api.h:383:25: note: 'napi_is_arraybuffer' declared here
NAPI_EXTERN napi_status napi_is_arraybuffer(napi_env env,
^
In file included from ../src/backup.cc:2:
In file included from /Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/node-addon-api/napi.h:2636:
/Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/node-addon-api/napi-inl.h:1581:24: error: use of undeclared
identifier 'napi_detach_arraybuffer'
napi_status status = napi_detach_arraybuffer(_env, _value);
^
⠴ Building modules: 0/1../src/backup.cc:179:9: warning: unused variable 'status' [-Wunused-variable]
int status = napi_create_async_work(
^
../src/backup.cc:252:5: warning: unused variable 'status' [-Wunused-variable]
BACKUP_BEGIN(Step);
^
../src/macros.h:182:9: note: expanded from macro 'BACKUP_BEGIN'
int status = napi_create_async_work( \
^
../src/backup.cc:319:5: warning: unused variable 'status' [-Wunused-variable]
BACKUP_BEGIN(Finish);
^
../src/macros.h:182:9: note: expanded from macro 'BACKUP_BEGIN'
int status = napi_create_async_work( \
^
⠧ Building modules: 0/13 warnings and 2 errors generated.
make: *** [Release/obj.target/node_sqlite3/src/backup.o] Error 1
✖ Rebuild Failed
An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild '/Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/sqlite3'.
Error: `make` failed with exit code: 2
Error: node-gyp failed to rebuild '/Users/henryoconnor/Documents/secretary/electron-app/src/node_modules/sqlite3'.
Error: `make` failed with exit code: 2
at ModuleRebuilder.rebuildNodeGypModule (/Users/henryoconnor/Documents/secretary/electron-app/node_modules/electron-rebuild/lib/src/module-rebuilder.js:193:19)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Rebuilder.rebuildModuleAt (/Users/henryoconnor/Documents/secretary/electron-app/node_modules/electron-rebuild/lib/src/rebuild.js:190:9)
at async Promise.all (index 105)
at async Rebuilder.rebuild (/Users/henryoconnor/Documents/secretary/electron-app/node_modules/electron-rebuild/lib/src/rebuild.js:148:13)
at async /Users/henryoconnor/Documents/secretary/electron-app/node_modules/electron-rebuild/lib/src/cli.js:146:9
child_process.js:655
throw err;
^
Error: Command failed: ../node_modules/.bin/electron-rebuild --parallel --force --types prod,dev,optional --module-dir .
at checkExecSyncError (child_process.js:616:11)
at execSync (child_process.js:652:15)
at Object.<anonymous> (/Users/henryoconnor/Documents/secretary/electron-app/.erb/scripts/ElectronRebuild.js:18:3)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Module._compile (/Users/henryoconnor/Documents/secretary/electron-app/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Object.newLoader [as .js] (/Users/henryoconnor/Documents/secretary/electron-app/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
status: 255,
signal: null,
output: [ null, null, null ],
pid: 9189,
stdout: null,
stderr: null
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
package.json
{
"name": "secretary",
"productName": "Secretary",
"description": "A personal secretary for handling daily work.",
"scripts": {
"build": "concurrently \"yarn build:main\" \"yarn build:renderer\"",
"build:main": "cross-env NODE_ENV=production webpack --config ./.erb/configs/webpack.config.main.prod.babel.js",
"build:renderer": "cross-env NODE_ENV=production webpack --config ./.erb/configs/webpack.config.renderer.prod.babel.js",
"rebuild": "electron-rebuild --parallel --types prod,dev,optional --module-dir src",
"lint": "cross-env NODE_ENV=development eslint . --cache --ext .js,.jsx,.ts,.tsx",
"package": "rm -rf src/dist && yarn build && electron-builder build --publish never",
"postinstall": "node -r #babel/register .erb/scripts/CheckNativeDep.js && electron-builder install-app-deps && yarn cross-env NODE_ENV=development webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.babel.js && opencollective-postinstall && yarn-deduplicate yarn.lock",
"start": "node -r #babel/register ./.erb/scripts/CheckPortInUse.js && cross-env yarn start:renderer",
"start:main": "cross-env NODE_ENV=development electron -r ./.erb/scripts/BabelRegister ./src/main.dev.ts",
"start:renderer": "cross-env NODE_ENV=development webpack serve --config ./.erb/configs/webpack.config.renderer.dev.babel.js",
"test": "jest"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"cross-env NODE_ENV=development eslint --cache"
],
"{*.json,.{babelrc,eslintrc,prettierrc}}": [
"prettier --ignore-path .eslintignore --parser json --write"
],
"*.{css,scss}": [
"prettier --ignore-path .eslintignore --single-quote --write"
],
"*.{html,md,yml}": [
"prettier --ignore-path .eslintignore --single-quote --write"
]
},
"build": {
"productName": "Secretary",
"appId": "secretary",
"files": [
"dist/",
"node_modules/",
"index.html",
"main.prod.js",
"main.prod.js.map",
"package.json"
],
"afterSign": ".erb/scripts/Notarize.js",
"mac": {
"target": [
"dmg"
],
"type": "distribution",
"hardenedRuntime": true,
"entitlements": "assets/entitlements.mac.plist",
"entitlementsInherit": "assets/entitlements.mac.plist",
"gatekeeperAssess": false
},
"dmg": {
"contents": [
{
"x": 130,
"y": 220
},
{
"x": 410,
"y": 220,
"type": "link",
"path": "/Applications"
}
]
},
"win": {
"target": [
"nsis"
]
},
"linux": {
"target": [
"AppImage"
],
"category": "Development"
},
"directories": {
"app": "src",
"buildResources": "assets",
"output": "release"
},
"extraResources": [
"./assets/**"
],
"publish": {
"provider": "github",
"owner": "electron-react-boilerplate",
"repo": "electron-react-boilerplate"
}
},
"jest": {
"testURL": "http://localhost/",
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/.erb/mocks/fileMock.js",
"\\.(css|less|sass|scss)$": "identity-obj-proxy"
},
"moduleFileExtensions": [
"js",
"jsx",
"ts",
"tsx",
"json"
],
"moduleDirectories": [
"node_modules",
"src/node_modules"
],
"setupFiles": [
"./.erb/scripts/CheckBuildsExist.js"
]
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/plugin-proposal-class-properties": "^7.12.1",
"#babel/plugin-proposal-decorators": "^7.12.1",
"#babel/plugin-proposal-do-expressions": "^7.12.1",
"#babel/plugin-proposal-export-default-from": "^7.12.1",
"#babel/plugin-proposal-export-namespace-from": "^7.12.1",
"#babel/plugin-proposal-function-bind": "^7.12.1",
"#babel/plugin-proposal-function-sent": "^7.12.1",
"#babel/plugin-proposal-json-strings": "^7.12.1",
"#babel/plugin-proposal-logical-assignment-operators": "^7.12.1",
"#babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
"#babel/plugin-proposal-optional-chaining": "^7.12.7",
"#babel/plugin-proposal-pipeline-operator": "^7.12.1",
"#babel/plugin-proposal-throw-expressions": "^7.12.1",
"#babel/plugin-syntax-dynamic-import": "^7.8.3",
"#babel/plugin-syntax-import-meta": "^7.10.4",
"#babel/plugin-transform-react-constant-elements": "^7.12.1",
"#babel/plugin-transform-react-inline-elements": "^7.12.1",
"#babel/plugin-transform-runtime": "^7.12.1",
"#babel/preset-env": "^7.12.7",
"#babel/preset-react": "^7.12.7",
"#babel/preset-typescript": "^7.12.7",
"#babel/register": "^7.12.1",
"#pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"#teamsupercell/typings-for-css-modules-loader": "^2.4.0",
"#testing-library/jest-dom": "^5.11.6",
"#testing-library/react": "^11.2.2",
"#types/enzyme": "^3.10.5",
"#types/enzyme-adapter-react-16": "^1.0.6",
"#types/history": "4.7.6",
"#types/jest": "^26.0.15",
"#types/node": "14.14.10",
"#types/react": "^16.9.44",
"#types/react-dom": "^16.9.9",
"#types/react-router-dom": "^5.1.6",
"#types/react-test-renderer": "^16.9.3",
"#types/webpack-env": "^1.15.2",
"#typescript-eslint/eslint-plugin": "^4.8.1",
"#typescript-eslint/parser": "^4.8.1",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.1.0",
"babel-loader": "^8.2.2",
"babel-plugin-dev-expression": "^0.2.2",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"browserslist-config-erb": "^0.0.1",
"chalk": "^4.1.0",
"concurrently": "^5.3.0",
"core-js": "^3.6.5",
"cross-env": "^7.0.2",
"css-loader": "^5.0.1",
"css-minimizer-webpack-plugin": "^1.1.5",
"detect-port": "^1.3.0",
"electron": "^11.0.1",
"electron-builder": "^22.3.6",
"electron-devtools-installer": "^3.1.1",
"electron-notarize": "^1.0.0",
"electron-rebuild": "^2.3.2",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.3",
"enzyme-to-json": "^3.5.0",
"eslint": "^7.5.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-airbnb-typescript": "^12.0.0",
"eslint-config-erb": "^2.0.0",
"eslint-config-prettier": "^6.11.0",
"eslint-import-resolver-webpack": "^0.13.0",
"eslint-plugin-compat": "^3.8.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.0.8",
"file-loader": "^6.0.0",
"husky": "^4.2.5",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.1.0",
"lint-staged": "^10.2.11",
"mini-css-extract-plugin": "^1.3.1",
"node-sass": "^5.0.0",
"opencollective-postinstall": "^2.0.3",
"prettier": "^2.0.5",
"react-refresh": "^0.9.0",
"react-test-renderer": "^17.0.1",
"rimraf": "^3.0.0",
"sass-loader": "^10.1.0",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.0.3",
"typescript": "^4.0.5",
"url-loader": "^4.1.0",
"webpack": "^5.5.1",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-cli": "^4.2.0",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^5.4.0",
"yarn-deduplicate": "^3.1.0"
},
"dependencies": {
"#fullcalendar/daygrid": "^5.5.0",
"#fullcalendar/react": "^5.5.0",
"#getstation/electron-google-oauth2": "^2.1.0",
"#reduxjs/toolkit": "^1.5.0",
"#tippyjs/react": "^4.2.0",
"electron-debug": "^3.1.0",
"electron-log": "^4.2.4",
"electron-updater": "^4.3.4",
"googleapis": "^67.1.0",
"history": "^5.0.0",
"jquery": "^3.5.1",
"js-cookie": "^2.2.1",
"lodash": "^4.17.21",
"moment": "^2.29.1",
"moment-timezone": "^0.5.33",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-modal": "^3.12.1",
"react-redux": "^7.2.2",
"react-router-dom": "^5.2.0",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0",
"regenerator-runtime": "^0.13.7",
"reselect": "^4.0.0",
"sanitize-html": "^2.3.2",
"source-map-support": "^0.5.19",
"styled-components": "^5.2.1"
},
"devEngines": {
"node": ">=10.x",
"npm": ">=6.x",
"yarn": ">=1.21.3"
},
"browserslist": [],
"prettier": {
"overrides": [
{
"files": [
".prettierrc",
".babelrc",
".eslintrc"
],
"options": {
"parser": "json"
}
}
],
"singleQuote": true
},
"renovate": {
"extends": [
"bliss"
],
"baseBranches": [
"next"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}
src/package.json
{
"name": "electron-react-boilerplate",
"productName": "electron-react-boilerplate",
"version": "2.3.0",
"description": "Electron application boilerplate based on React, React Router, Webpack, React Hot Loader for rapid application development",
"main": "./main.prod.js",
"author": {
"name": "Electron React Boilerplate Maintainers",
"email": "electronreactboilerplate#gmail.com",
"url": "https://github.com/electron-react-boilerplate"
},
"scripts": {
"electron-rebuild": "node -r ../.erb/scripts/BabelRegister.js ../.erb/scripts/ElectronRebuild.js",
"postinstall": "yarn electron-rebuild"
},
"license": "MIT",
"dependencies": {
"sqlite": "^4.0.19",
"sqlite3": "^5.0.2"
}
}
I downgraded the sqlite3 package to v5.0.0 and it rebuilt correctly. Hope this helps anyone else with the same issue.
Source: nodejs electronjs sqlite3 - use of undeclared identifier 'napi_is_detached_arraybuffer'
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"
}
}}
When trying to open webpack with yarn s I get the following error:
yarn s
yarn run v1.7.0
$ NODE_ENV=development webpack --config webpack.development.js
/bin/sh: webpack: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I tried searching on google for the answer most promising seemed https://gist.github.com/DanHerbert/9520689 but still doesn't work. Anyone has any ideas?
This is my package.json:
cat package.json
{
"name": "Random",
"private": true,
"version": "1.0.0",
"engines": {
"node": "6.9.1",
"yarn": ">=0.27.5"
},
"repository": {
"type": "git",
"url": "random"
},
"scripts": {
"s": "NODE_ENV=development webpack --config webpack.development.js",
"production": "NODE_ENV=production webpack --config webpack.production.js",
"postinstall": "sh -c 'if [ \"${NODE_ENV}\" = \"production\" ]; then yarn run production; fi'",
"precommit:eslint": "git diff-index --cached HEAD --name-only --diff-filter ACMR | grep -E \"\\.jsx?$\" | xargs eslint --quiet"
},
"pre-commit": [
"precommit:eslint"
],
"dependencies": {
"assets-webpack-plugin": "^3.5.1",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "6.11.1",
"classnames": "2.2.5",
"clean-webpack-plugin": "^0.1.16",
"compression-webpack-plugin": "^1.0.0",
"happypack": "^4.0.0-beta.2",
"history": "3.0.0",
"immutable": "3.8.1",
"jquery": "3.1.1",
"json-loader": "0.5.4",
"lodash": "4.17.4",
"moment": "2.19.3",
"moment-timezone": "0.5.11",
"react": "15.3.0",
"react-addons-shallow-compare": "15.3.0",
"react-transition-group": "2.3.1",
"react-big-calendar": "^0.17.0",
"react-bootstrap": "^0.31.5",
"react-d3-cloud": "0.4.1",
"react-datepicker": "0.37.0",
"react-dates": "4.1.0",
"react-dom": "15.3.0",
"react-immutable-render-mixin": "0.9.7",
"react-linkify": "0.1.3",
"react-modal": "1.4.0",
"react-notification-system": "0.2.7",
"react-pagify": "2.0.4",
"react-pagify-preset-bootstrap": "1.0.2",
"react-redux": "4.4.5",
"react-router": "3.0.0",
"react-select": "1.0.0-rc.5",
"react-tag-input": "4.6.2",
"react-text-mask": "^5.0.2",
"redux": "3.6.0",
"redux-form": "6.2.0",
"redux-logger": "2.7.0",
"redux-thunk": "2.1.0",
"seamless-immutable": "^7.1.2",
"strip-ansi": "^4.0.0",
"text-mask-addons": "3.7.1",
"webpack": "^3.5.5"
},
"devDependencies": {
"babel-eslint": "7.1.0",
"eslint": "3.9.0",
"eslint-config-airbnb": "12.0.0",
"eslint-loader": "1.6.1",
"eslint-plugin-import": "1.16.0",
"eslint-plugin-jsx-a11y": "2.2.3",
"eslint-plugin-react": "6.4.1",
"pre-commit": "1.2.2"
}
}
When I run npm s I get:
npm s
npm ERR! search must be called with arguments
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/luciantarna/.npm/_logs/2018-05-28T13_34_20_437Z-debug.log
cat /Users/luciantarna/.npm/_logs/2018-05-28T13_34_20_437Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/10.2.1/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 's' ]
2 info using npm#5.6.0
3 info using node#v10.2.1
4 verbose stack Error: search must be called with arguments
4 verbose stack at EventEmitter.search (/usr/local/lib/node_modules/npm/lib/search.js:35:15)
4 verbose stack at Object.commandCache.(anonymous function) (/usr/local/lib/node_modules/npm/lib/npm.js:159:13)
4 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:84:30)
4 verbose stack at process._tickCallback (internal/process/next_tick.js:61:11)
5 verbose cwd /Users/luciantarna/govpredict/gov_congress
6 verbose Darwin 17.5.0
7 verbose argv "/usr/local/Cellar/node/10.2.1/bin/node" "/usr/local/bin/npm" "s"
8 verbose node v10.2.1
9 verbose npm v5.6.0
10 error search must be called with arguments
11 verbose exit [ 1, true ]
I don't even know why it gets node 10.2.1 when i installed node6.
I have this in webpack.development.js:
cat webpack.development.js
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const StatusPlugin = require('./front/utils/webpack-status-plugin');
const HappyPack = require('happypack');
const paths = {
src: path.join(__dirname, 'front'),
dest: path.join(__dirname, 'public', 'front'),
};
module.exports = {
context: paths.src,
devtool: 'eval',
entry: {
application: ['babel-polyfill', './application.js'],
admin: ['babel-polyfill', './admin.js'],
portal: ['babel-polyfill', './portal.js'],
},
externals: {
jquery: 'jQuery',
underscore: '_',
},
output: {
path: paths.dest,
filename: '[name].bundle.js',
sourceMapFilename: '[name].js.map',
},
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'happypack/loader',
},
{
parser: {
amd: false,
},
},
],
},
plugins: [
new CleanWebpackPlugin(paths.dest),
new HappyPack({
loaders: ['babel-loader'],
verbose: false,
}),
StatusPlugin,
],
resolve: {
modules: [paths.src, 'node_modules'],
},
watch: true,
watchOptions: {
ignored: /node_modules/,
},
};
I think you forgot to run npm install
First of all, you'll need to run yarn command, to install the dependencies.
I was cloning an already existing project. As I was building, I got this error saved in the npm-debug.log:
0 info it worked if it ends with ok
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 'bundle-dep' ]
2 info using npm#2.10.1
3 info using node#v0.12.4
4 verbose run-script [ 'prebundle-dep', 'bundle-dep', 'postbundle-dep' ]
5 info prebundle-dep sdk#1.0.0
6 info bundle-dep sdk#1.0.0
7 verbose unsafe-perm in lifecycle true
8 info sdk#1.0.0 Failed to exec bundle-dep script
9 verbose stack Error: sdk#1.0.0 bundle-dep: `jspm bundle "src - [src/**/*] - [components/**/*]" www/bundle.js`
9 verbose stack Exit status 1
9 verbose stack at EventEmitter.<anonymous> (c:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16)
9 verbose stack at EventEmitter.emit (events.js:110:17)
9 verbose stack at ChildProcess.<anonymous> (c:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack at ChildProcess.emit (events.js:110:17)
9 verbose stack at maybeClose (child_process.js:1015:16)
9 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
10 verbose pkgid sdk#1.0.0
11 verbose cwd c:\GIT\mas\Rapid\hide
12 error Windows_NT 6.1.7601
13 error argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "bundle-dep"
14 error node v0.12.4
15 error npm v2.10.1
16 error code ELIFECYCLE
17 error sdk#1.0.0 bundle-dep: `jspm bundle "src - [src/**/*] - [components/**/*]" www/bundle.js`
17 error Exit status 1
18 error Failed at the sdk#1.0.0 bundle-dep script 'jspm bundle "src - [src/**/*] - [components/**/*]" www/bundle.js'.
18 error This is most likely a problem with the sdk package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error jspm bundle "src - [src/**/*] - [components/**/*]" www/bundle.js
18 error You can get their info via:
18 error npm owner ls sdk
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
While here's the package.json:
{
"name": "sdk",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"postinstall": "typings install && bower install --production && jspm install && node src/tools/updateDependencies.js && npm run bundle-dep",
"_jspm": "jspm install",
"_postjspm": "node src/tools/updateDependencies.js && npm run bundle-dep",
"bundle-dep": "jspm bundle \"src - [src/**/*] - [components/**/*]\" www/bundle.js",
"start": "node dev-server.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"jspm": "^0.17.0-beta.12",
"typings": "^0.7.12"
},
"devDependencies": {
"angular2": "2.0.0-beta.15",
"chokidar-socket-emitter": "^0.3.1",
"express": "^4.13.4",
"open": "0.0.5",
"rxjs": "5.0.0-beta.2",
"spdy": "^3.2.3"
},
"jspm": {
"name": "sdk",
"directories": {
"lib": "src"
},
"dependencies": {
"angular2": "npm:angular2#2.0.0-beta.15",
"es6-shim": "github:es-shims/es6-shim#^0.35.0",
"json": "github:systemjs/plugin-json#^0.1.0",
"systemjs-hot-reloader": "github:capaj/systemjs-hot-reloader#^0.5.6"
},
"devDependencies": {
"os": "github:jspm/nodelibs-os#^0.2.0-alpha",
"plugin-typescript": "github:frankwallis/plugin-typescript#^4.0.5"
},
"peerDependencies": {
"assert": "github:jspm/nodelibs-assert#^0.2.0-alpha",
"fs": "github:jspm/nodelibs-fs#^0.2.0-alpha",
"net": "github:jspm/nodelibs-net#^0.2.0-alpha",
"process": "github:jspm/nodelibs-process#^0.2.0-alpha",
"reflect-metadata": "npm:reflect-metadata#0.1.2",
"rxjs": "npm:rxjs#^5.0.0-beta.2",
"tty": "github:jspm/nodelibs-tty#^0.2.0-alpha",
"util": "github:jspm/nodelibs-util#^0.2.0-alpha",
"zone.js": "npm:zone.js#^0.6.6"
},
"overrides": {
"npm:angular2#2.0.0-beta.15": {
"main": false,
"dependencies": {
"reflect-metadata": "npm:reflect-metadata#0.1.2",
"rxjs": "npm:rxjs#^5.0.0-beta.2",
"zone.js": "npm:zone.js#^0.6.6"
},
"peerDependencies": {
"reflect-metadata": "npm:reflect-metadata#0.1.2",
"rxjs": "npm:rxjs#^5.0.0-beta.2",
"zone.js": "npm:zone.js#^0.6.6"
},
"jspmNodeConversion": false,
"map": {
"crypto": "#empty"
},
"meta": {
"src/*.js": {
"deps": [
"reflect-metadata",
"zone.js"
]
}
},
"format": "detect"
},
"npm:debug#2.2.0": {
"main": "browser.js",
"jspmNodeConversion": false,
"format": "cjs",
"map": {
"./browser.js": {
"node": "./node.js"
},
"fs": "#node/fs",
"net": "#node/net",
"tty": "#node/tty",
"util": "#node/util"
}
},
"npm:ms#0.7.1": {
"jspmNodeConversion": false,
"format": "cjs"
},
"npm:reflect-metadata#0.1.2": {
"map": {
"crypto": "#empty"
}
},
"npm:typescript#1.8.9": {
"browser": {},
"map": {
"buffer": "#empty",
"child_process": "#empty",
"fs": "#empty",
"path": "#empty",
"process": "#empty",
"readline": "#empty"
}
}
}
}
}
It seems that the problem is on the bundle-dep under scripts. What could have gone wrong?
The error is caused by a script triggered as part of the install.
This is in the package.json:
"scripts": {
"postinstall": ... && jspm install ..."
It looks like this package expects you to have jspm already installed globally.
If you trust this package, you can run npm install -g jspm and try again.
More documents here.