Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to fix “Error: Exit code: 1. Command failed: node-gyp rebuild”

I was using electron-vue to build a desk app ,I don't have node-gyp in my dependencies,when I tried to run the script "npm run dist",Here came the strange error.

I have no idea what's going on here,I got stuck here for few days,

Here is the error: Error: Exit code: 1. Command failed: node-gyp rebuild gyp info it worked if it ends with ok gyp info using node-gyp@3.8.0 gyp info using node@10.14.2 | darwin | x64 gyp info spawn /usr/local/bin/python2.7 gyp info spawn args [ '/Users/james/200--Work/202--Front End/projection-electron/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', .......... .......... gyp: binding.gyp not found (cwd: /Users/james/200--Work/202--Front End/projection-electron) while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/Users/james/200--Work/202--Front End/projection-electron/node_modules/node-gyp/lib/configure.js:345:16) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12) gyp ERR! System Darwin 18.2.0 gyp ERR! command "/usr/local/bin/node" "/Users/james/200--Work/202--Front End/projection-electron/node_modules/.bin/node-gyp" "rebuild" gyp ERR! cwd /Users/james/200--Work/202--Front End/projection-electron gyp ERR! node -v v10.14.2 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok

Here is the part of package.json

"scripts": { "dev": "webpack", "start": "electron .", "rebuild": "electron-rebuild -f -w sqlite3", "pack": "electron-builder --dir", "dist": "electron-builder" },

"dependencies": { "@types/qs": "^6.5.1", "@types/sqlite3": "^3.1.3", "axios": "^0.16.1", "qs": "^6.5.2", "sqlite3": "^4.0.4", "vue": "^2.0.1", "vue-router": "^3.0.1", "vuex": "^3.0.1" },

How could I fix the problem?

Comments