6-pubsub: Error on npm start
astanwar99 opened this issue · 6 comments
I am getting this error when I try to start local web server using npm. I have also tried using yarn but doesn't help.
C:\Users\Ashwani\AppData\Local\Google\Cloud SDK\nodejs-getting-started\6-pubsub>npm start
> nodejs-getting-started@1.0.0 start C:\Users\Ashwani\AppData\Local\Google\Cloud SDK\nodejs-getting-started\6-pubsub
> node ${SCRIPT:-app.js}
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module 'C:\Users\Ashwani\AppData\Local\Google\Cloud SDK\nodejs-getting-started\6-pubsub\${SCRIPT:-app.js}'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nodejs-getting-started@1.0.0 start: `node ${SCRIPT:-app.js}`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodejs-getting-started@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\Ashwani\AppData\Roaming\npm-cache\_logs\2019-03-28T14_46_30_743Z-debug.log
This is the log file:
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 npm@6.4.1
3 info using node@v10.15.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle nodejs-getting-started@1.0.0~prestart: nodejs-getting-started@1.0.0
6 info lifecycle nodejs-getting-started@1.0.0~start: nodejs-getting-started@1.0.0
7 verbose lifecycle nodejs-getting-started@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle nodejs-getting-started@1.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Ashwani\AppData\Local\Google\Cloud SDK\nodejs-getting-started\6-pubsub\node_modules\.bin;C:\Users\Ashwani\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\libnvvp;D:\SOFTWARES\INSTALLED\Oracledb\product\12.2.0\dbhome_1\bin;D:\SOFTWARES\INSTALLED\Oracle\product\12.2.0\dbhome_1\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;D:\PROGRAMMING\TDM-GCC\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\Autodesk\Backburner\;D:\SOFTWARES\INSTALLED\GTK2-Runtime\lib;.;C:\adb;C:\MinGW\bin;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microsoft VS Code\bin;D:\SOFTWARES\INSTALLED\Git\cmd;C:\Program Files\cURL\bin;C:\Program Files\Mercurial\;C:\Go\bin;;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs\;C:\Program Files (x86)\Yarn\bin\;D:\SOFTWARES\INSTALLED\Oracledb\product\12.2.0\dbhome_1\bin;D:\SOFTWARES\INSTALLED\Oracle\product\12.2.0\dbhome_1\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;D:\PROGRAMMING\TDM-GCC\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\Autodesk\Backburner\;D:\SOFTWARES\INSTALLED\GTK2-Runtime\lib;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\SOFTWARES\INSTALLED\Git\cmd;C:\Users\Ashwani\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Docker Toolbox;D:\PROGRAMMING\GoProjects\bin;C:\Users\Ashwani\AppData\Roaming\npm;C:\Users\Ashwani\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin;C:\Users\Ashwani\AppData\Local\Yarn\bin;
9 verbose lifecycle nodejs-getting-started@1.0.0~start: CWD: C:\Users\Ashwani\AppData\Local\Google\Cloud SDK\nodejs-getting-started\6-pubsub
10 silly lifecycle nodejs-getting-started@1.0.0~start: Args: [ '/d /s /c', 'node ${SCRIPT:-app.js}' ]
11 silly lifecycle nodejs-getting-started@1.0.0~start: Returned: code: 1 signal: null
12 info lifecycle nodejs-getting-started@1.0.0~start: Failed to exec start script
13 verbose stack Error: nodejs-getting-started@1.0.0 start: `node ${SCRIPT:-app.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:301:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
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:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid nodejs-getting-started@1.0.0
15 verbose cwd C:\Users\Ashwani\AppData\Local\Google\Cloud SDK\nodejs-getting-started\6-pubsub
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v10.15.3
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error nodejs-getting-started@1.0.0 start: `node ${SCRIPT:-app.js}`
22 error Exit status 1
23 error Failed at the nodejs-getting-started@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 ]
I have been following through this tutorial and everything works fine till Logging Application Events. If anyone can help me figure out what's the issue? Thanks.
It works for me with Node 10. Can you start the app in the other folders? Have you set all the environment variables?
I am also working with Node 10. These are included in path variables:
PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin; C:\Users\Ashwani\AppData\Local\Google\Cloud SDK\nodejs-getting-started\6-pubsub\node_modules\.bin;
I am not sure if there's error in environment variables because as I mentioned, everything works fine till previous module. I'll check the variables once more and try other locations for the app. Thanks.
Let us know if the issue still persists and we can reopen this issue.
I'm with the same problem.
There are a solution?
I found "node ${SCRIPT:-app.js}", at package.json
and I replaced it by "node app.js",
It worked!