after create-react-app failed to start script - node.js

Failed at the start script and didn't run nothing, while running the following command:
npm start
The Error
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"webpack-dev-server": "3.2.1"
Don't try to install it manually: your package manager does it automatically.
However, a different version of webpack-dev-server was detected higher up in the tree:
/home/akhilbatchu/node_modules/webpack-dev-server (version: 3.8.1)
Manually installing incompatible versions is known to cause hard-to-debug issues.
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.
To fix the dependency tree, try following the steps below in the exact order:
1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
2. Delete node_modules in your project folder.
3. Remove "webpack-dev-server" from dependencies and/or devDependencies in the package.json file in your project folder.
4. Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
This may help because npm has known issues with package hoisting which may get resolved in future versions.
6. Check if /home/akhilbatchu/node_modules/webpack-dev-server is outside your project directory.
For example, you might have accidentally installed something in your home folder.
7. Try running npm ls webpack-dev-server in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed webpack-dev-server.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.
P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! appnamsse#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appnamsse#0.1.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! /home/akhilbatchu/.npm/_logs/2019-11-14T06_22_13_747Z-debug.log
Here is the complete log about what happened:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/home/akhilbatchu/.nvm/versions/node/v12.13.0/bin/node',
1 verbose cli '/home/akhilbatchu/.nvm/versions/node/v12.13.0/bin/npm',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm#6.12.0
3 info using node#v12.13.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle appnamsse#0.1.0~prestart: appnamsse#0.1.0
6 info lifecycle appnamsse#0.1.0~start: appnamsse#0.1.0
7 verbose lifecycle appnamsse#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle appnamsse#0.1.0~start: PATH: /home/akhilbatchu/.nvm/versions/node/v12.13.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/akhilbatchu/appnamsse/node_modules/.bin:/home/akhilbatchu/.nvm/versions/node/v12.13.0/bin:/home/akhilbatchu/anaconda3/bin:/home/akhilbatchu/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
9 verbose lifecycle appnamsse#0.1.0~start: CWD: /home/akhilbatchu/appnamsse
10 silly lifecycle appnamsse#0.1.0~start: Args: [ '-c', 'react-scripts start' ]
11 silly lifecycle appnamsse#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle appnamsse#0.1.0~start: Failed to exec start script
13 verbose stack Error: appnamsse#0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/home/akhilbatchu/.nvm/versions/node/v12.13.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:210:5)
13 verbose stack at ChildProcess.<anonymous> (/home/akhilbatchu/.nvm/versions/node/v12.13.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:210:5)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid appnamsse#0.1.0
15 verbose cwd /home/akhilbatchu/appnamsse
16 verbose Linux 4.15.0-64-generic
17 verbose argv "/home/akhilbatchu/.nvm/versions/node/v12.13.0/bin/node" "/home/akhilbatchu/.nvm/versions/node/v12.13.0/bin/npm" "start"
18 verbose node v12.13.0
19 verbose npm v6.12.0
20 error code ELIFECYCLE
21 error errno 1
22 error appnamsse#0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the appnamsse#0.1.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 ]
Versions:
Node: v12.13.0
NPM: v6.12.0
Environment
react: "^16.11.0",
react-dom: "^16.11.0",
react-scripts: "3.2.0"
Could anyone please help me as I am not able to figure out what is going wrong and completely new to react.
Thank you.

Have you installed the dependencies .
npm install
If it doesn't work delete the node_modules folder from project. then
npm install
npm start

Did you read the first error message?
It says (step 6) you have (accidentally, probably) installed a copy of webpack-dev-server into your home directory
/home/akhilbatchu/node_modules/webpack-dev-server
Get rid of that copy (for instance, rename /home/akhilbatchu/node_modules into /home/akhilbatchu/node_modules_unused if you don't want to outright remove it), then try again.

I did followed this steps to work
npm install -g npm#latest it'll update npm, in case your modules are not updated
rm -rf node_modules
Delete node_modules in your project folder. as mentioned in the log
npm install
Run npm install or yarn, depending on the package manager you use. as it is mentioned in the console

Related

Neither NPM nor GitBash are operational at the moment. How can that be solved?

I am new to GitBash and do not know how it functions within VisualStudio Code. The challenge that I am faced with is enabling React.js to operate within VSCode. As it stands, the error message below is what's being output at this time.
D:\_Dearest_Lord_God,_please_intuitively_reveal_the_things_that_used_to_baffle_me]\_Projects-React]\node_modules\babel-jest (version: 27.2.4)
Manually installing incompatible versions is known to cause hard-to-debug issues.
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.
To fix the dependency tree, try following the steps below in the exact order:
1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
2. Delete node_modules in your project folder.
3. Remove "babel-jest" from dependencies and/or devDependencies in the package.json file in your project folder.
4. Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
This may help because npm has known issues with package hoisting which may get resolved in future versions.
6. Check if D:\_Dearest_Lord_God,_please_intuitively_reveal_the_things_that_used_to_baffle_me]\_Projects-React]\node_modules\babel-jest is outside your project directory.
For example, you might have accidentally installed something in your home folder.
7. Try running npm ls babel-jest in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed babel-jest.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.
P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! affiliate-marketing-project#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the affiliate-marketing-project#0.1.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\Refined_Silver\AppData\Roaming\npm-cache\_logs\2021-10-12T16_55_33_704Z-debug.log
PS D:\_Dearest_Lord_God,_please_intuitively_reveal_the_things_that_used_to_baffle_me]\_Projects-React]\affiliate-marketing-project>
I followed the instructions above, but to no avail. For starters, "babel-jest" did not exist within the dependencies section of my package.json.
Below is the message that I have been receiving, which is inside of the debug log for React within Visual Studio Code.
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 'start'
1 verbose cli ]
2 info using npm#6.14.15
3 info using node#v14.18.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle affiliate-marketing-project#0.1.0~prestart: affiliate-marketing-project#0.1.0
6 info lifecycle affiliate-marketing-project#0.1.0~start: affiliate-marketing-project#0.1.0
7 verbose lifecycle affiliate-marketing-project#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle affiliate-marketing-project#0.1.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\_Dearest_Lord_God,_please_intuitively_reveal_the_things_that_used_to_baffle_me]\_Projects-React]\affiliate-marketing-project\node_modules\.bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Python39\Scripts\;C:\Python39\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\Git\cmd;C:\Ruby26-x64\bin;C:\Users\Refined_Silver\AppData\Local\Microsoft\WindowsApps;C:\Users\Refined_Silver\AppData\Local\Programs\Microsoft VS Code\bin;C:\ProgramData\Refined_Silver\GitHubDesktop\bin;C:\Users\Refined_Silver\AppData\Roaming\npm;C:\Users\Refined_Silver\AppData\Local\Yarn\bin
9 verbose lifecycle affiliate-marketing-project#0.1.0~start: CWD: D:\_Dearest_Lord_God,_please_intuitively_reveal_the_things_that_used_to_baffle_me]\_Projects-React]\affiliate-marketing-project
10 silly lifecycle affiliate-marketing-project#0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle affiliate-marketing-project#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle affiliate-marketing-project#0.1.0~start: Failed to exec start script
13 verbose stack Error: affiliate-marketing-project#0.1.0 start: `react-scripts start`
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:400:28)
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:400:28)
13 verbose stack at maybeClose (internal/child_process.js:1058:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
14 verbose pkgid affiliate-marketing-project#0.1.0
15 verbose cwd D:\_Dearest_Lord_God,_please_intuitively_reveal_the_things_that_used_to_baffle_me]\_Projects-React]\affiliate-marketing-project
16 verbose Windows_NT 10.0.19043
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v14.18.0
19 verbose npm v6.14.15
20 error code ELIFECYCLE
21 error errno 1
22 error affiliate-marketing-project#0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the affiliate-marketing-project#0.1.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 ]
I am not-at-all familiar with how to read what is happening within the NPM / GitBash start-up process. Everything was working fine until I installed GitBash. I would appreciate some assistance with how GitBash functions.
I would appreciate any insight as to how this can be solved. Thank you.
Have you followed step 6 and removed babel-jest in D:\_Dearest_Lord_God,_please_intuitively_reveal_the_things_that_used_to_baffle_me]\_Projects-React]\node_modules ?
react-scripts comes with babel-jest. It warns you about the conflicting installation up the tree.

npm ERR! Unexpected end of JSON input while parsing near '...registry.npmjs.org/#i'

I am new to ionic and i am still trying to install it. Everytime i write an ionic command like npm install -g ionic cordova i receive this error
npm ERR! Unexpected end of JSON input while parsing near '...de":"0.6.2","express"'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\DwayneT\AppData\Roaming\npm-cache\_logs\2019-05-31T01_51_23_542Z-debug.log
'
this is my log file
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli
'C:\\Users\\DwayneT\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-
cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'ionic',
1 verbose cli 'cordova' ]
2 info using npm#6.9.0
3 info using node#v8.11.1
4 verbose npm-session bf0a16c3729a6897
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 304 http://registry.npmjs.org/cordova 1407ms (from cache)
8 silly fetchPackageMetaData error for cordova#latest Unexpected end of JSON
input while parsing near '...de":"0.6.2","express"'
9 http fetch GET 304 http://registry.npmjs.org/ionic 1418ms (from cache)
10 silly pacote tag manifest for ionic#latest fetched in 1452ms
11 timing stage:rollbackFailedOptional Completed in 1ms
12 timing stage:runTopLevelLifecycles Completed in 1466ms
13 verbose stack SyntaxError: Unexpected end of JSON input while parsing
near '...de":"0.6.2","express"'
13 verbose stack at JSON.parse (<anonymous>)
13 verbose stack at parseJson
(C:\Users\DwayneT\AppData\Roaming\npm\node_modules\npm\node_modules\json-
parse-better-errors\index.js:7:17)
13 verbose stack at consumeBody.call.then.buffer
(C:\Users\DwayneT\AppData\Roaming\npm\node_modules\npm\node_modules\node-
fetch-npm\src\body.js:96:50)
13 verbose stack at <anonymous>
13 verbose stack at process._tickCallback
(internal/process/next_tick.js:188:7)
14 verbose cwd C:\Users\DwayneT
15 verbose Windows_NT 10.0.18362
16 verbose argv "C:\\Program Files\\nodejs\\node.exe"
"C:\\Users\\DwayneT\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-
cli.js" "install" "-g" "ionic" "cordova"
17 verbose node v8.11.1
18 verbose npm v6.9.0
19 error Unexpected end of JSON input while parsing near
'...de":"0.6.2","express"'
20 verbose exit [ 1, true ]
I have tried many solutions including
npm cache clean --force
but nothing seems to work and i am now now. Kindly assist please. I am using node v 8
It is the problem with npm corrupt caches. You can clear it using npm itself.
I solved it with
npm cache clean --force
then update npm
npm i npm#latest -g
then normally use your npm install command
npm install
Try run npm cache clean --force then re-run your command, I hope this fix this issue for you.
Try cleaning the npm cache use the below command. This will clean your existing npm entries and start from the beginning. I think the one file may be corrupt during the installation that's why you are facing this issue.
npm cache clean
Then try
npm install ionic -g
I've faced the problem.
when you uninstalled node js or delete the npm global packages or install the node js in a new machine that error will have occurred.
Please install global npm packages after installing the npm install or npm i
For Example My Case I've uninstalled npm global package. When I installed npm install, an error occurred.
You should clear the npm cache files manually by going to
C:\Users[Username]\AppData\Roaming\npm-cache
change [user
I've resolved this issue in the following way:
npm cache clean --force
and
npm cache verify
then
npm i npm#latest -g
and finally, I was able to run
npm i

sh: 1: cross-env: Permission denied on laravel mix

I'm trying to run npm run dev but the following error occur:
sh: 1: cross-env: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! # development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the # development 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/shanmaseen/.npm/_logs/2019-02-22T16_32_08_191Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! # dev: `npm run development`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the # dev 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/shanmaseen/.npm/_logs/2019-02-22T16_32_08_241Z-debug.log
I've been searching the internet for a week, nothing helped at all !
I even tried to remove 'cross-env' from package.json scripts, but then webpack: permission denied happened, indicating that the permission error is not by cross-env it self.
this is the error log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'dev' ]
2 info using npm#6.7.0
3 info using node#v11.10.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle #~predev: #
6 info lifecycle #~dev: #
7 verbose lifecycle #~dev: unsafe-perm in lifecycle true
8 verbose lifecycle #~dev: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/media/e/www/mwar/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 #~dev: CWD: /media/e/www/mwar
10 silly lifecycle #~dev: Args: [ '-c', 'npm run development' ]
11 silly lifecycle #~dev: Returned: code: 126 signal: null
12 info lifecycle #~dev: Failed to exec dev script
13 verbose stack Error: # dev: `npm run development`
13 verbose stack Exit status 126
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:197: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:197:13)
13 verbose stack at maybeClose (internal/child_process.js:984:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid #
15 verbose cwd /media/e/www/mwar
16 verbose Linux 4.18.0-15-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
18 verbose node v11.10.0
19 verbose npm v6.7.0
20 error code ELIFECYCLE
21 error errno 126
22 error # dev: `npm run development`
22 error Exit status 126
23 error Failed at the # dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 126, true ]
I'm using laravel 5.7mix.
node version: v11.10.0
npm version: 6.7.0
any help please?
I was on ubuntu 18.
Following command helped me :-)
npm rebuild
Documented as follows, on the official website.
This command runs the npm build command on the matched folders. This is useful when you install a new version of node, and must recompile all your C++ addons with the new binary. It is also useful when installing with --ignore-scripts and --no-bin-links, to explicitly choose which packages to build and/or link bins.
If one or more package names (and optionally version ranges) are provided, then only packages with a name and version matching one of the specifiers will be rebuilt.
This is because of permission issues with global installation of packages, which npm is being denied access.
To solve this try
1.
npm rebuild
npm run watch
Or 2
rm -Rf node_modules
npm install
npm run watch
Hope it works.
The following thing worked for me
chmod -R a+x node_modules
source
If file and/or directory permissions were changed to more restrictive ones, a permission error like the following can happen on Ubuntu Linux:
$ npm run watch
> watch
> mix watch
sh: 1: mix: Permission denied
to resolve that on Ubuntu Linux, this worked for me:
chmod -R u+x node_modules
It gives+ you as useru executionx permission recursively -R to the node_modules directory and everything inside it.
Be careful, think about security and do not use the a, o nor the g flag instead of the u flag, which would give all, others or group execution rights. The g flag might be ok, if you trust all the users in the group.
As ruuter states in comments, it would be even better for security, if you find the exact file(s) that need execution permission and grant execution permission only for these files.
As #savedbeau suggests, running the following fixes this problem:
npm rebuild
followed by
npm run watch
Try this.
$ rm -rf node_modules
$ npm cache clear --force
$ npm install npm#latest -g
$ chown -R $USER ~/.npm
$ npm install
Ok I figure out the problem, the storage where the project is saved is auto-mounted and it have no execution permission.
easily in /etc/fstab file i added exec in the mount option, like this:
auto,user,exec,utf8,uid=1000,gid=1000,rw 0 0

Electron works, a bit...?

I installed the latest version of node and electron and tried out the samples. They work when I enter "npm start".
However: when I try to make an app in another folder and launch it, I get this npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using npm#3.10.10
3 info using node#v6.11.2
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle proton-template-app#1.0.0~prestart: proton-template-app#1.0.0
6 silly lifecycle proton-template-app#1.0.0~prestart: no script for prestart, continuing
7 info lifecycle proton-template-app#1.0.0~start: proton-template-app#1.0.0
8 verbose lifecycle proton-template-app#1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle proton-template-app#1.0.0~start: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/erik/Projects/Electron/tmp2/node_modules/.bin:/home/erik/bin:/home/erik/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
10 verbose lifecycle proton-template-app#1.0.0~start: CWD: /home/erik/Projects/Electron/tmp2
11 silly lifecycle proton-template-app#1.0.0~start: Args: [ '-c', 'electron .' ]
12 info lifecycle proton-template-app#1.0.0~start: Failed to exec start script
13 verbose stack Error: proton-template-app#1.0.0 start: `electron .`
13 verbose stack spawn ENOENT
13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:33:16)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at ChildProcess.emit (events.js:191:7)
13 verbose stack at maybeClose (internal/child_process.js:891:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
14 verbose pkgid proton-template-app#1.0.0
15 verbose cwd /home/erik/Projects/Electron/tmp2
16 error Linux 4.4.0-79-generic
17 error argv "/usr/bin/node" "/usr/bin/npm" "start"
18 error node v6.11.2
19 error npm v3.10.10
20 error file sh
21 error code ELIFECYCLE
22 error errno ENOENT
23 error syscall spawn
24 error proton-template-app#1.0.0 start: `electron .`
24 error spawn ENOENT
25 error Failed at the proton-template-app#1.0.0 start script 'electron .'.
25 error Make sure you have the latest version of node.js and npm installed.
25 error If you do, this is most likely a problem with the proton-template-app package,
25 error not with npm itself.
25 error Tell the author that this fails on your system:
25 error electron .
25 error You can get information on how to open an issue for this project with:
25 error npm bugs proton-template-app
25 error Or if that isn't available, you can get their info via:
25 error npm owner ls proton-template-app
25 error There is likely additional logging output above.
26 verbose exit [ 1, true ]
I'm afraid my install wasn't 100% ok, what should I do? Install again? How do I uninstall correctly? - I'm stuck, please help ;-)
The technicality is in your package.json, and your installation of Electron, but this is regardless of having it saved under dependencies.
If your start script in package.json calls electron ., you will need to install Electron globally with npm install electron -g. This goes for all commands where you use the name, much like mocha and cordova create. Just some examples.
To use it locally (non-globally) and only inside the project, you can just call npm install electron (which you may have done), but your startscript will have to point to the electron file inside the local node_modules folder. Usually the path is node_modules/.bin/electron.cmd, and your start script can look like node_modules/.bin/electron .
If you ever come across this problem inside an IDE, you should set electron.cmd in .bin as your executable, then . as your arguments.
Make sure you have installed electron globally, to do so run the following command:
npm install -g electron
Once you have installed it try running electron in your command prompt it should open a demo app.
To uninstall electron from the global scope:
npm uninstall -g electron

npm start fails because of node-api# ELIFECYCLE

I have a problem starting a node.js server. The server app was tested on another system and worked perfectly.
The error log says that something is wrong with the node-api# but I was not able to find any solution.
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm#2.9.1
3 info using node#v0.12.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart node-api#
6 info start node-api#
7 verbose unsafe-perm in lifecycle true
8 info node-api# Failed to exec start script
9 verbose stack Error: node-api# start: `node server.js`
9 verbose stack Exit status 1
9 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/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> (/usr/local/lib/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 node-api#
11 verbose cwd /Volumes/HDD/Users/…/app/db
12 error Darwin 14.3.0
13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
14 error node v0.12.3
15 error npm v2.9.1
16 error code ELIFECYCLE
17 error node-api# start: `node server.js`
17 error Exit status 1
18 error Failed at the node-api# start script 'node server.js'.
18 error This is most likely a problem with the node-api package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error node server.js
18 error You can get their info via:
18 error npm owner ls node-api
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
What is wrong with my installation and how can I solve this?
Two things you can try here:
Ensure that you are running the same version of Node as the other system where it was seen running perfectly. You can test this by entering the following on your terminal and the terminal it was working on: node -v. If they're different, look to upgrade (or indeed downgrade) your installation.
Delete the node_modules directory from the project root on your current computer, then run an npm install to ensure that the binaries that were compiled are compatible with your operating system.
I got to this page looking for a solution to a similar error log.
My problem was that I had started the webpack dev server in the background and had forgotten to kill it before asking Node to start it up again.
Try to find the process PID (second column of output)
ps -u [your user name]
Then send the SIGINT signal (2) to the process with the PID
kill -2 [PID]
Hope this helps others that come to this page.
I faced same problem. For my case, I it occurred after adding following line
in my package.json file.
"scripts": {
"start": "node index.js"
}
After remove the start scripts it solved.
Now I am running my server by node index.js
I reinstalled the webpack and it worked
 
"npm i --save-dev webpack#1.14.0"
Clear the system cache and run the command in the terminal
npm cache clean --force
then
npm start
I got this same error when I have compilation errors in my code. I've used npm start
I wouldn't claim to entirely understand the solution. I think it had something to do with either incorrect addresses recorded to navigate node_modules, or it may have been my version of watchman was outdated or corrupted.
I fixed the issue by reinstalling watchman and deleting/recreating the node_modules and package-lock.json files.
npm cache clean --force
rm -rf node_modules
rm -rf package-lock.json
brew uninstall watchman
npm r -g watchman
npm install watchman
npm install
npm start
It's a long chain and a pretty uncertain answer; but after being stuck for a long time this is what got me past it.
Good luck.
I had something like that, and my mistake was that i do not have permission of access to the folders, so i was using Manjaro and i run my app with
sudo npm start
and that

Resources