NPM run-script init-cloudsql skipping user prompt - node.js

I'm just starting here so sorry in advance if this seems obvious,
I've been getting myself accustomed with the appengine back-end and am following Google's bookshelf example as a start.
Everything was going okay until I run the NPM run-script init-cloudsql command and for some reason after I enter the host IP of my db the cmd skips the user prompt and asks me for the password. Then it tried to launch the script with an anonymous user.
I'm following the instructions as described, I get no errors in the previous steps.
Below is the log of my run-script:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\barda\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run-script',
1 verbose cli 'init-cloudsql' ]
2 info using npm#3.5.0
3 info using node#v4.2.2
4 verbose run-script [ 'preinit-cloudsql', 'init-cloudsql', 'postinit-cloudsql' ]
5 info lifecycle nodejs-getting-started#1.0.0~preinit-cloudsql: nodejs-getting-started#1.0.0
6 silly lifecycle nodejs-getting-started#1.0.0~preinit-cloudsql: no script for preinit-cloudsql, continuing
7 info lifecycle nodejs-getting-started#1.0.0~init-cloudsql: nodejs-getting-started#1.0.0
8 verbose lifecycle nodejs-getting-started#1.0.0~init-cloudsql: unsafe-perm in lifecycle true
9 verbose lifecycle nodejs-getting-started#1.0.0~init-cloudsql: PATH: C:\Users\barda\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\nodejs-getting-started-2-structured-data\node_modules\.bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\apache-maven-3.3.9\bin\;C:\Users\barda\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin;C:\Users\barda\AppData\Roaming\npm;C:\Program Files\nodejs\
10 verbose lifecycle nodejs-getting-started#1.0.0~init-cloudsql: CWD: C:\nodejs-getting-started-2-structured-data
11 silly lifecycle nodejs-getting-started#1.0.0~init-cloudsql: Args: [ '/d /s /c', 'node books/model-cloudsql.js' ]
12 silly lifecycle nodejs-getting-started#1.0.0~init-cloudsql: Returned: code: 1 signal: null
13 info lifecycle nodejs-getting-started#1.0.0~init-cloudsql: Failed to exec init-cloudsql script
14 verbose stack Error: nodejs-getting-started#1.0.0 init-cloudsql: `node books/model-cloudsql.js`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (C:\Users\barda\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:232:16)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at EventEmitter.emit (events.js:172:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Users\barda\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:24:14)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at ChildProcess.emit (events.js:172:7)
14 verbose stack at maybeClose (internal/child_process.js:818:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid nodejs-getting-started#1.0.0
16 verbose cwd C:\nodejs-getting-started-2-structured-data
17 error Windows_NT 10.0.10586
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\barda\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run-script" "init-cloudsql"
19 error node v4.2.2
20 error npm v3.5.0
21 error code ELIFECYCLE
22 error nodejs-getting-started#1.0.0 init-cloudsql: `node books/model-cloudsql.js`
22 error Exit status 1
23 error Failed at the nodejs-getting-started#1.0.0 init-cloudsql script 'node books/model-cloudsql.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the nodejs-getting-started package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node books/model-cloudsql.js
23 error You can get their info via:
23 error npm owner ls nodejs-getting-started
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

Related

How do I solve an nexe compilation code 2 error?

I am trying to compile my node server using nexe (3.3.2) but it keeps failing. When I first tried, it said I needed to use the --build flag which I included in my script. The process kicked off again, compiled for over two hours and then failed.
I upgraded my node and npm versions using Homebrew, it didn't work. I thought it might be the size of the folders I've included but even if I just include my server.js, it fails.
Does anyone have any ideas for me please? Below is a copy of the latest log file.
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/usr/local/lib/node_modules/node/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using npm#6.14.4
3 info using node#v13.8.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle robson-callcentre#0.1.0~prebuild: robson-callcentre#0.1.0
6 info lifecycle robson-callcentre#0.1.0~build: robson-callcentre#0.1.0
7 verbose lifecycle robson-callcentre#0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle robson-callcentre#0.1.0~build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/darryllrobinson/Documents/projects/Source/fonebookeohcollections/server/node_modules/.bin:/usr/local/opt/openssl/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin
9 verbose lifecycle robson-callcentre#0.1.0~build: CWD: /Users/darryllrobinson/Documents/projects/Source/fonebookeohcollections/server
10 silly lifecycle robson-callcentre#0.1.0~build: Args: [ '-c', 'nexe server.js --build' ]
11 silly lifecycle robson-callcentre#0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle robson-callcentre#0.1.0~build: Failed to exec build script
13 verbose stack Error: robson-callcentre#0.1.0 build: `nexe server.js --build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:321:20)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:321:20)
13 verbose stack at maybeClose (internal/child_process.js:1026:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid robson-callcentre#0.1.0
15 verbose cwd /Users/darryllrobinson/Documents/projects/Source/fonebookeohcollections/server
16 verbose Darwin 19.4.0
17 verbose argv "/usr/local/lib/node_modules/node/bin/node" "/usr/local/bin/npm" "run" "build"
18 verbose node v13.8.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error robson-callcentre#0.1.0 build: `nexe server.js --build`
22 error Exit status 1
23 error Failed at the robson-callcentre#0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I wasn't able to resolve the problem so I used pkg instead.

Error: spawn cmd ENOENT while starting React APP

I am creating a React Application. I ran the following command in cmd:
npx create-react-app .
Thereafter I tried to start the server using npm start as instructed in the tutorial:
https://github.com/facebook/create-react-app.
However, I keep getting the following error:
Error: spawn cmd ENOENT.
The log report generated by the error is:
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.10.2
3 info using node#v12.9.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle react_todo#0.1.0~prestart: react_todo#0.1.0
6 info lifecycle react_todo#0.1.0~start: react_todo#0.1.0
7 verbose lifecycle react_todo#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle react_todo#0.1.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\Projects\react_todo\node_modules\.bin;C:\Program Files\Java\jdk1.8.0_181\bin;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;E:\Projects\shopping-cart\node_modules\express-generator\bin;C:\Program Files\Git\cmd;C:\Program Files\PuTTY\;C:\Users\Arun\AppData\Local\Programs\Python\Python37-32\Scripts\;C:\Users\Arun\AppData\Local\Programs\Python\Python37-32\;C:\Users\Arun\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files (x86)\EasyPHP-Devserver-17\eds-binaries\dbserver\mysql5717x86x191225091928\bin;
9 verbose lifecycle react_todo#0.1.0~start: CWD: E:\Projects\react_todo
10 silly lifecycle react_todo#0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle react_todo#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle react_todo#0.1.0~start: Failed to exec start script
13 verbose stack Error: react_todo#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:326:16)
13 verbose stack at EventEmitter.emit (events.js:209: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:209:13)
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 react_todo#0.1.0
15 verbose cwd E:\Projects\react_todo
16 verbose Windows_NT 6.1.7600
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.9.1
19 verbose npm v6.10.2
20 error code ELIFECYCLE
21 error errno 1
22 error react_todo#0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the react_todo#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 ]
It would be really helpful if could suggest me a way to resolve this issue. Thank You.
I resolved the issue by following these steps if anyone needs it in future:
Goto > Control Panel\System and Security\System\Advance system setting\Enviroment variable and set system variables path C:\Windows\System32\ variable and restart your System.
This comment really helped me out: https://github.com/facebook/create-react-app/issues/6908#issuecomment-495064048.
You should install create-react-app globally with -g.
npm install -g create-react-app
Alternatively, you could skip the installation of create-react-app.
For that you need firstly to update to a newer version of nodejs and npm and then you can run.
npx create-react-app yourappname

Build nodejs Fail with exit status 126 - Permission denied

I faced a issue when I do a npm start in my linux server.
It is showing error with exit code 126 and permission denied.
I have already done chmod 777 to server.js or rather to the whole folder of demoTest.
How do I fixed this?
The log is shown as below.
info it worked if it ends with ok
1 verbose cli [ '/opt/node-v8.11.3-linux-x64/bin/node', '/bin/npm', 'start' ]
2 info using npm#5.6.0
3 info using node#v8.11.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle demoTest#1.0.0~prestart: demoTest#1.0.0
6 info lifecycle demoTest#1.0.0~start: demoTest#1.0.0
7 verbose lifecycle demoTest#1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle demoTest#1.0.0~start: PATH: /opt/node-v8.11.3-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/useradmin/demoTest/node_modules/.bin:/sbin:/bin:/usr/sbin:/usr/bin
9 verbose lifecycle demoTest#1.0.0~start: CWD: /home/useradmin/demoTest
10 silly lifecycle demoTest#1.0.0~start: Args: [ '-c', 'nodemon ./rest/server.js' ]
11 silly lifecycle demoTest#1.0.0~start: Returned: code: 126 signal: null
12 info lifecycle demoTest#1.0.0~start: Failed to exec start script
13 verbose stack Error: demoTest#1.0.0 start: `nodemon ./rest/server.js`
13 verbose stack Exit status 126
13 verbose stack at EventEmitter.<anonymous> (/opt/node-v8.11.3-linux-x64/lib/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.<anonymous> (/opt/node-v8.11.3-linux-x64/lib/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 demoTest#1.0.0
15 verbose cwd /home/useradmin/demoTest/rest
16 verbose Linux 3.10.0-862.el7.x86_64
17 verbose argv "/opt/node-v8.11.3-linux-x64/bin/node" "/bin/npm" "start"
18 verbose node v8.11.3
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 126
22 error demoTest#1.0.0 start: `nodemon ./rest/server.js`
22 error Exit status 126
23 error Failed at the demoTest#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 [ 126, true ]
I was getting this same issue when running a Nodejs server and Reactjs client. This process worked for me and should be done in the affected directory (I think that's demoTest for you):
Delete node_modules
Run npm install to reinstall the dependencies in that directory's package.json
I believe this problem started when I copied node_modules from my host to my Ubuntu server rather than running the installs directly from the server CLI.
I am using nodemon and intellij was complaining with "app/server.js: Permission denied, errno 126" until I added the following to my config in package.json.
"scripts": {
"start": "nodemon app/server.js"
}

Run reactJS client with NodeJS

I am .net developer.Previous developer used nodeJS and react for one project.I must complete that project.That project use nodeJS,and reactJS.I installed NodeJS in windows 8
I install packages(npm install) it worked well.But now I try to run-start project but it give error
When I write npm start it give that error
Failed at the react-seed #0.0.13 start script node_env=development node dev-server .webpack/config
here is 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#2.14.20
3 info using node#v4.4.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart react-seed#0.0.13
6 verbose unsafe-perm in lifecycle true
7 info start react-seed#0.0.13
8 verbose unsafe-perm in lifecycle true
9 info react-seed#0.0.13 Failed to exec start script
10 verbose stack Error: react-seed#0.0.13 start: `NODE_ENV=development node dev-server ./webpack/config`
10 verbose stack Exit status 1
10 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:214:16)
10 verbose stack at emitTwo (events.js:87:13)
10 verbose stack at EventEmitter.emit (events.js:172:7)
10 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
10 verbose stack at emitTwo (events.js:87:13)
10 verbose stack at ChildProcess.emit (events.js:172:7)
10 verbose stack at maybeClose (internal/child_process.js:827:16)
10 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
11 verbose pkgid react-seed#0.0.13
12 verbose cwd C:\nodeAQ
13 error Windows_NT 6.3.9600
14 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
15 error node v4.4.1
16 error npm v2.14.20
17 error code ELIFECYCLE
18 error react-seed#0.0.13 start: `NODE_ENV=development node dev-server ./webpack/config`
18 error Exit status 1
19 error Failed at the react-seed#0.0.13 start script 'NODE_ENV=development node dev-server ./webpack/config'.
19 error This is most likely a problem with the react-seed package,
19 error not with npm itself.
19 error Tell the author that this fails on your system:
19 error NODE_ENV=development node dev-server ./webpack/config
19 error You can get information on how to open an issue for this project with:
19 error npm bugs react-seed
19 error Or if that isn't available, you can get their info via:
19 error
19 error npm owner ls react-seed
19 error There is likely additional logging output above.
20 verbose exit [ 1, true ]

node.js/Express server crashes on request

I just generated a server with express-generator. When I start the server and give it is first request, I get this error.
0 info it worked if it ends with ok
1 verbose cli [ '/Users/user/.nvm/versions/node/v4.2.4/bin/node',
1 verbose cli '/Users/user/.nvm/versions/node/v4.2.4/bin/npm',
1 verbose cli 'start' ]
2 info using npm#3.5.2
3 info using node#v4.2.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle sevn#0.0.0~prestart: sevn#0.0.0
6 silly lifecycle sevn#0.0.0~prestart: no script for prestart, continuing
7 info lifecycle sevn#0.0.0~start: sevn#0.0.0
8 verbose lifecycle sevn#0.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle sevn#0.0.0~start: PATH: /Users/user/.nvm/versions/node/v4.2.4/lib/node_modules/npm/bin/node-gyp-bin:/Users/user/Projects/sevn/node_modules/.bin:/Users/user/.nvm/versions/node/v4.2.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
10 verbose lifecycle sevn#0.0.0~start: CWD: /Users/user/Projects/sevn
11 silly lifecycle sevn#0.0.0~start: Args: [ '-c', 'node ./bin/www' ]
12 silly lifecycle sevn#0.0.0~start: Returned: code: 1 signal: null
13 info lifecycle sevn#0.0.0~start: Failed to exec start script
14 verbose stack Error: sevn#0.0.0 start: `node ./bin/www`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/Users/user/.nvm/versions/node/v4.2.4/lib/node_modules/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at EventEmitter.emit (events.js:172:7)
14 verbose stack at ChildProcess.<anonymous> (/Users/user/.nvm/versions/node/v4.2.4/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at ChildProcess.emit (events.js:172:7)
14 verbose stack at maybeClose (internal/child_process.js:818:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid sevn#0.0.0
16 verbose cwd /Users/user/Projects/sevn
17 error Darwin 15.2.0
18 error argv "/Users/user/.nvm/versions/node/v4.2.4/bin/node" "/Users/user/.nvm/versions/node/v4.2.4/bin/npm" "start"
19 error node v4.2.4
20 error npm v3.5.2
21 error code ELIFECYCLE
22 error sevn#0.0.0 start: `node ./bin/www`
22 error Exit status 1
23 error Failed at the sevn#0.0.0 start script 'node ./bin/www'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the sevn package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node ./bin/www
23 error You can get information on how to open an issue for this project with:
23 error npm bugs sevn
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls sevn
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
What is wrong? Where can I start debugging?
Btw, I have Node.js version v4.2.4 and npm v.3.5.2
Thanks!
Edit: I get an 304 status, shouldn't I get an 200?
The problem was that I hadn't installed compass which I used for express server.
Problem solved with:
gem install compass

Resources