Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"npm start" command with errors #11

Open
mastodontusrexus opened this issue Apr 11, 2018 · 3 comments
Open

"npm start" command with errors #11

mastodontusrexus opened this issue Apr 11, 2018 · 3 comments

Comments

@mastodontusrexus
Copy link

Hi guys,

I am following this REACT tutorial. I came across a problem while trying to install webpack-dev-server. NPM returned info that webpack-dev-server is now replaced by webpack-dev (which has been installed).

Nevertheless when I'm trying to run "npm script" I am being asked to instal webpack CLI which I am trying to do but there is a bunch of errors at the end.
Could any of you look at them and point me in the right direction please?

PS C:\Users\Prosiaczek\Desktop\react_app\react-playlist> npm start

[email protected] start C:\Users\Prosiaczek\Desktop\react_app\react-playlist
npm run build

[email protected] build C:\Users\Prosiaczek\Desktop\react_app\react-playlist
webpack -d && webpack-dev-server --content-base src/ --inline --hot --port 1234

The CLI moved into a separate package: webpack-cli
Would you like to install webpack-cli? (That will run npm install -D webpack-cli) (yes/NO)y
up to date in 12.204s
``
{ Error: Cannot find module 'webpack-cli'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at runCommand.then.result (C:\Users\Prosiaczek\Desktop\react_app\react-playlist\node_modules\webpack\bin\webpack.js:62:14)
at
at process._tickCallback (internal/process/next_tick.js:188:7) code: 'MODULE_NOT_FOUND' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: webpack -d && webpack-dev-server --content-base src/ --inline --hot --port 1234
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build 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\Prosiaczek\AppData\Roaming\npm-cache_logs\2018-04-11T12_51_02_172Z-debug.log
``

The error 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 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 info lifecycle [email protected]
start: [email protected]
7 verbose lifecycle [email protected]start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Prosiaczek\Desktop\react_app\react-playlist\node_modules.bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\AuthenTec TrueSuite;C:\Program Files\AuthenTec TrueSuite\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Skype\Phone;C:\Program Files (x86)\Brackets\command;C:\Android;C:\Windows\System32;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\MongoDB\Server\3.6\bin;C:\python\Scripts;C:\python;C:\Users\Prosiaczek\Anaconda3;C:\Users\Prosiaczek\Anaconda3\Scripts;C:\Users\Prosiaczek\Anaconda3\Library\bin;C:\mysql\bin;C:\Users\Prosiaczek\AppData\Roaming\Dashlane\5.9.0.17744\bin\Firefox_Extension{442718d9-475e-452a-b3e1-fb1ee16b8e9f}\components;C:\Users\Prosiaczek\AppData\Roaming\Dashlane\5.9.0.17744\ucrt;C:\Users\Prosiaczek\AppData\Roaming\npm; C:\Program Files\Git\bin;C:\Users\Prosiaczek\AppData\Local\atom\bin;.;;.;;.;;.;;.;;.;;.;
9 verbose lifecycle [email protected]start: CWD: C:\Users\Prosiaczek\Desktop\react_app\react-playlist
10 silly lifecycle [email protected]
start: Args: [ '/d /s /c', 'npm run build' ]
11 silly lifecycle [email protected]start: Returned: code: 1 signal: null
12 info lifecycle [email protected]
start: Failed to exec start script
13 verbose stack Error: [email protected] start: npm run build
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285: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. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Users\Prosiaczek\Desktop\react_app\react-playlist
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v8.9.4
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: npm run build
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

@sylvacoin
Copy link

I think it has something to do with webpack. config.js

@AKASHAGARWAL0403
Copy link

I also faced the same issue.... this is due to the fact that you are using webpack v2 in webpack v1...
try to install the webpack version1 and do it.

@jugghayd
Copy link

@AKASHAGARWAL0, how do you know which webpack you have installed? And how do you install a different version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants