How to diagnose this error? - javascript

I'm trying to run voxel-hello-world (a Minecraft-like game, which runs in the browser). I get the following error when I try to access the page at localhost:
4 verbose stack Error: voxel-hello-world#0.6.0 start: `beefy test.js:bundle.js 8080`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:242:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:852:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
Details (incl. npm-debug.log) can be found here.
I have no experience with Node.js. My suspicion was that the version of Node.js may be compatible with this code, which AFAIK was written couple of years ago. I tried several older versions of Node.js with the same result.
How can I fix this error? What is it root cause?
Update 1: When I run beefy test.js:bundle.js, I get this:
C:\dev\voxel-hello-world>beefy test.js:bundle.js 8080
module.js:457
throw err;
^
Error: Cannot find module 'C:\Users\pisarenko\Documents\dev\voxel-hello-world\node_modules\browserify/bin/args.js'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at setupBrowserify (C:\Users\pisarenko\AppData\Roaming\npm\node_modules\beefy\lib\bundlers\browserify.js:6:19)
at onlocalbrowserify (C:\Users\pisarenko\AppData\Roaming\npm\node_modules\beefy\lib\setup-bundlers.js:30:5)
at C:\Users\pisarenko\AppData\Roaming\npm\node_modules\beefy\node_modules\resolve\lib\async.js:42:21
at C:\Users\pisarenko\AppData\Roaming\npm\node_modules\beefy\node_modules\resolve\lib\async.js:121:35
at C:\Users\pisarenko\AppData\Roaming\npm\node_modules\beefy\node_modules\resolve\lib\async.js:93:39
at C:\Users\pisarenko\AppData\Roaming\npm\node_modules\beefy\node_modules\resolve\lib\async.js:59:30
I tried to install browserify...
C:\Users\pisarenko\Documents\dev\voxel-hello-world>npm install browserify -g
C:\Users\pisarenko\AppData\Roaming\npm\browserify -> C:\Users\pisarenko\AppData\Roaming\npm\node_modules\browserify\bin\cmd.js
C:\Users\pisarenko\AppData\Roaming\npm
`-- browserify#13.1.0
But then the same error came.
Update 2: Changing the port to 8085 doesn't help.
C:\Users\pisarenko\Documents\dev\voxel-hello-world>npm start
> voxel-hello-world#0.6.0 start C:\Users\pisarenko\Documents\dev\voxel-hello-world
> beefy test.js:bundle.js 8085
listening on 8085
using .\node_modules\.bin\browserify
200 75ms 1.08KB /index.html
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn C:\Users\pisarenko\Documents\dev\voxel-hello-world\node_modules\.bin\browserify ENOENT
at exports._errnoException (util.js:1026:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
at onErrorNT (internal/child_process.js:348:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.4.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! voxel-hello-world#0.6.0 start: `beefy test.js:bundle.js 8085`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the voxel-hello-world#0.6.0 start script 'beefy test.js:bundle.js 8085'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the voxel-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! beefy test.js:bundle.js 8085
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs voxel-hello-world
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls voxel-hello-world
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\pisarenko\Documents\dev\voxel-hello-world\npm-debug.log
C:\Users\pisarenko\Documents\dev\voxel-hello-world>
Update 3: Running
npm install beefy
npm install browserify
doesn't help.
Update 4: Here's the contens of the directory voxel-hello-world\node_modules\.bin\.
Update 5: According to the output of npm --verbose start npm tries to execute the command beefy test.js:bundle.js 8085:
C:\Users\pisarenko\Documents\dev\voxel-hello-world>npm --verbose start
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli '--verbose',
npm verb cli 'start' ]
npm info using npm#3.10.3
npm info using node#v6.4.0
npm verb run-script [ 'prestart', 'start', 'poststart' ]
npm info lifecycle voxel-hello-world#0.6.0~prestart: voxel-hello-world#0.6.0
npm info lifecycle voxel-hello-world#0.6.0~start: voxel-hello-world#0.6.0
voxel-hello-world#0.6.0 start C:\Users\pisarenko\Documents\dev\voxel-hello-world
beefy test.js:bundle.js 8085
When I try to run that command myself, it can't find file C:\Users\pisarenko\Documents\dev\voxel-hello-world\node_modules\browserify/bin/args.js, which doesn't exist in that directory (see screenshot below).
C:\Users\pisarenko\Documents\dev\voxel-hello-world>beefy test.js:bundle.js 8085
module.js:457
throw err;
^
Error: Cannot find module 'C:\Users\pisarenko\Documents\dev\voxel-hello-world\node_modules\browserify/bin/args.js'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at setupBrowserify (C:\Users\pisarenko\AppData\Roaming\npm\node_modules\beefy\lib\bundlers\browserify.js:6:19)
at onlocalbrowserify (C:\Users\pisarenko\AppData\Roaming\npm\node_modules\beefy\lib\setup-bundlers.js:30:5)
at C:\Users\pisarenko\AppData\Roaming\npm\node_modules\beefy\node_modules\resolve\lib\async.js:42:21
at C:\Users\pisarenko\AppData\Roaming\npm\node_modules\beefy\node_modules\resolve\lib\async.js:121:35
at C:\Users\pisarenko\AppData\Roaming\npm\node_modules\beefy\node_modules\resolve\lib\async.js:93:39
at C:\Users\pisarenko\AppData\Roaming\npm\node_modules\beefy\node_modules\resolve\lib\async.js:59:30

Quick workaround: edit voxel-hello-world/node_modules/beefy/index.js, replace this line (line 64?):
bfy = spawn(browserify_path, args)
with
bfy = spawn(browserify_path, args, {shell: true})
, then npm start, open it in chrome
I reproduced same error with following commands in git bash:
$ git clone https://github.com/maxogden/voxel-hello-world
$ cd voxel-hello-world/
$ npm -v
3.3.6
$ node -v
v6.1.0
$ cmd /c ver
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
> exit
$ npm i
$ npm start
beefy spawns command line browserify without shell, this works on Linux since node_modules/.bin/browserify is a valid executable. But Windows can't execute it.
Adding the options {shell: true} is to start a shell (cmd.exe) and run the command in it, browserify resolves to the batch file browserify.cmd in the shell.
Global installation of browserify or other packages are not required, npm start and other npm scripts automatically adds executable of local packages to PATH.

Related

npm install error about setting up the python path

I get this error while doing an npm start:
PS C:\Users\Concierge\downloads\prod\pdf2\ipfs_image_uploader> npm start
> react-box#0.1.0 start C:\Users\Concierge\downloads\prod\pdf2\ipfs_image_uploader
> node scripts/start.js
internal/modules/cjs/loader.js:582
throw err;
^
Error: Cannot find module 'dotenv'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (C:\Users\Concierge\downloads\prod\pdf2\ipfs_image_uploader\scripts\
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-box#0.1.0 start: `node scripts/start.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-box#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output ab
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Concierge\AppData\Roaming\npm-cache\_logs\2018-11-17T04_27_59_461Z-debug
PS C:\Users\Concierge\downloads\prod\pdf2\ipfs_image_uploader>
and when I run command npm install, I get this error:
> scrypt#6.0.3 preinstall /Users/user/Documents/pdfuploader/node_modules/scrypt
> node node-scrypt-preinstall.js
> scrypt#6.0.3 install /Users/user/Documents/pdfuploader/node_modules/scrypt
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "/path/to/executable/python2.7", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/user/Documents/pdfuploader/node_modules/scrypt
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN ajv-keywords#3.2.0 requires a peer of ajv#^6.0.0 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt#6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt#6.0.3 install 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! /Users/user/.npm/_logs/2018-11-18T05_45_00_864Z-debug.log`
I tried to set up the pythonpath like here: https://www.tutorialspoint.com/How-to-set-your-python-path-on-Mac but it didn't help
I just sort it out by using this tutorial to insert that path /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages :
https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/
but then again i got that error when npm run start: `users-Air:pdfuploader user$ npm run start
client#0.1.0 start /Users/user/Documents/pdfuploader
react-scripts start
Could not find a required file.
Name: index.html
Searched in: /Users/user/Documents/pdfuploader/public
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client#0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client#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! /Users/user/.npm/_logs/2018-11-18T06_44_50_004Z-debug.log`
Files which i am trying to npm run start:
https://github.com/damianjnc/pdfuploader
Some of the nodeJS modules are written in c++, and need to be compiled when being installed. This process requires python2 to be installed. Now, most Macs actually have python2 installed by default, but 'python' might not be on your executables path yet.
On a Mac, the python application is typically located at /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7. If there is no 'Python.framework' folder in /System/Library/Frameworks/ you will need to install python. If it is there, then simply symlink the previously mentioned python2.7 executable in /usr/bin. Also ensure that /usr/bin is present on your executable path by typing echo $PATH on your terminal.
To create a symlink run:
cd /usr/bin
sudo ln -s /path/to/original/python python

How to build VSCode on Windows?

I am trying to build https://github.com/Microsoft/vscode from the source, but I am not sure exactly what to do. When I ran scripts\npm.bat install, it completed successfully. Then I ran scripts\code.bat and a stranger window showed up. It is it the compiled version? It did not seem to work correctly.
How can I create full build? The page:
https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run-from-source
Does not offered how to create an executable from the source. When I run scripts\npm.bat install what should happen? For now I only see it create the folder out/out-build within some javascript files, as showed bellow. What are those files and what I do with them?
Later I tried to ran the scripts\code.bat and created an executable similar in size to the stable version on the folder .build\electron:
But when I ran npm run watch, this error is throw:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "D:\\User\\Documents\\Nodejs\\bin\\node.exe" "D:\\User\\Documents\\Nodejs\\bin\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! code-oss-dev#1.15.0 watch: `gulp watch --max_old_space_size=4096`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the code-oss-dev#1.15.0 watch script 'gulp watch --max_old_space_size=4096'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the code-oss-dev package,
npm ERR! not with npm itself.
I found the other question:
How to build release vscode version
But I could not figure it out correctly how to build it. Forehand I figured out the following steps to setup the environment:
Install NodeJS and npm. See
the tutorial How to Install Node.js® and NPM on
Windows
Run this command npm install --global --production windows-build-tools from cmd line as
Administrator. See npm install error - MSB3428: Could not load the Visual C++ component
“VCBuild.exe”
Install gulp. See gulpjs/gulp#Getting
Started
Steps to Reproduce
git clone https://github.com/Microsoft/vscode
cd vscode
scripts\npm.bat install
npm run watch
Outputs: F:\vscode>npm run watch
File npm-debug.log:
1) When I ran the command scripts\npm.bat install for the first time, this was the output:
F:\vscode>scripts\npm.bat install
2) When I ran the command scripts\npm.bat install for the after the first time, this was the output:
F:\vscode>scripts\npm.bat install
3) When I ran the command scripts\code.bat, this was the output:
F:\vscode>scripts\code.bat
And the following window showed up:
4) When I ran the command npm owner ls code-oss-dev as asked by the npm run watch error message, this was the output:
F:\vscode>npm owner ls code-oss-dev
npm ERR! owner ls Couldn't get owner data code-oss-dev
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "D:\\User\\Documents\\Nodejs\\bin\\node.exe" "D:\\User\\Documents\\Nodejs\\bin\\node_modules\\npm\\bin\\npm-cli.js" "owner" "ls" "code-oss-dev"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/code-oss-dev
npm ERR! 404
npm ERR! 404 'code-oss-dev' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! F:\vscode\npm-debug.log
F:\vscode>
5) When I ran the command npm bugs code-oss-dev as asked by the npm run watch error message, this was the error output:
F:\vscode>npm bugs code-oss-dev
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "D:\\User\\Documents\\Nodejs\\bin\\node.exe" "D:\\User\\Documents\\Nodejs\\bin\\node_modules\\npm\\bin\\npm-cli.js" "bugs" "code-oss-dev"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/code-oss-dev
npm ERR! 404
npm ERR! 404 'code-oss-dev' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! F:\vscode\npm-debug.log
F:\vscode>
6) I also ran the command gulp, this was the output:
F:\vscode>gulp
7) When I ran the command gulp compile-client-build, this was the output:
F:\vscode>gulp compile-client-build
[08:36:37] Using gulpfile F:\vscode\gulpfile.js
[08:36:37] Starting 'clean-client-build'...
[08:36:37] Finished 'clean-client-build' after 49 ms
[08:36:37] Starting 'compile-client-build'...
[08:36:38] Starting compilation...
[08:50:08] [monaco.d.ts] Starting monaco.d.ts generation
[08:50:12] [monaco.d.ts] Finished monaco.d.ts generation
[08:50:12] Finished compilation with 0 errors after 814540 ms
[08:50:12] Finished 'compile-client-build' after 14 min
8) When I ran the command gulp vscode-win32-ia32, this was the error output:
[02:15:28] Starting 'vscode-win32-ia32'...
internal/streams/legacy.js:59
throw er; // Unhandled stream error in pipe.
^
Error: read ECONNRESET
at exports._errnoException (util.js:1018:11)
at TLSWrap.onread (net.js:568:26)
F:\vscode>gulp vscode-win32-ia32
9) When I ran the command gulp vscode-win32-x64, this was the error output:
[03:02:59] Starting 'vscode-win32-x64'...
internal/streams/legacy.js:59
throw er; // Unhandled stream error in pipe.
^
Error: read ECONNRESET
at exports._errnoException (util.js:1018:11)
at TLSWrap.onread (net.js:568:26)
F:\vscode>gulp vscode-win32-x64
10) When I ran the command npm run gulp -- vscode-win32-ia32, this was the error output:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "D:\\User\\Documents\\Nodejs\\bin\\node.exe" "D:\\User\\Documents\\Nodejs\\bin\\node_modules\\npm\\bin\\npm-cli.js" "run" "gulp" "--" "vscode-win32-ia32"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! code-oss-dev#1.15.0 gulp: `gulp --max_old_space_size=4096 "vscode-win32-ia32"`
npm ERR! Exit status 3
F:\vscode>npm run gulp -- vscode-win32-ia32
File npm-debug.log for the command npm run gulp -- vscode-win32-ia32 just above.
11) When I ran the command gulp watch --max-old-space-size=4096, this was the output, and the program hanged on this line:
F:\vscode>gulp watch --max-old-space-size=4096
npm version
F:\vscode>npm --version
3.10.10
F:\vscode>node --version
v6.11.0
F:\vscode>ver
Microsoft Windows [Version 10.0.15063]
F:\vscode>python --version
Python 2.7.13 :: Continuum Analytics, Inc.
VSCode Version: code-oss-dev#1.15.0
OS Version: Windows 10 build 15063 x64
Originally posted on: Failed at the code-oss-dev#1.15.0 watch script 'gulp watch --max_old_space_size=4096'
Related issues:
Development Environment Improvements (code.bat/code.sh)
Errors Compiling from Source on Arch Linux
Unable to setup vscode locally
Debug Batch (.bat) files
"JavaScript heap out of memory" when building on RHEL-7
Failed at the electron-mksnapshot#1.6.0 install script
Unhandled stream error in pipe
stream.js:74 throw er; // Unhandled stream error in pipe.
Node.js – events js 72 throw er unhandled 'error' event
vscode-win32-ia32 build failure: JavaScript heap out of memory
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
npm/npm#FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
nodejs/node#FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
The problem seems to be the outdated version 6.11.0 of nodejs used. From the issue: Failed at the code-oss-dev#1.15.0 watch script 'gulp watch --max_old_space_size=4096' on the VSCode issue tracker, we may follow the steps:
Install Node 7.9.0
git clean -xfd .
git pull
.\scripts\npm.bat install
Then, if there are no errors:
npm run watch
Run it until it tells you compilation succeeded. Then:
.\scripts\code.bat
When I try to follow the instructions, I get:
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:310:5)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd F:\code\vscode\node_modules\native-watchdog
Not sure why, but it seems as if node-gyp cannot find visual studio.

Set up angular-seed from git bash - Error: EINVAL, invalid argument : Object.<anonymous> : Exit status 8

So here I am a java developer trying to learn Angular. Came across a lot of new stuff in this course. Now i was trying to set up angular-seed from my git bash and this error shows up when i run npm start. I am not quite sure where to look. Is this a node setup issue,guessing so because i done it myself as it wasn't in the tutorial. Any help is appreciated.
$ npm start
> angular-seed#0.0.0 prestart F:\0-TUTS\AngularJS 2 Essential Training\Angular-Learn with 10 example\AngularWeekend\templatestore
> npm install
> angular-seed#0.0.0 postinstall F:\0-TUTS\AngularJS 2 Essential Training\Angular- Learn with 10 example\AngularWeekend\templatestore
> bower install
> angular-seed#0.0.0 start F:\0-TUTS\AngularJS 2 Essential Training\Angular- Learn with 10 example\AngularWeekend\templatestore
> http-server -a localhost -p 8000 -c-1 ./app
Error: EINVAL, invalid argument
at new Socket (net.js:156:18)
at process.stdin (node.js:664:19)
at Object.<anonymous> (F:\0-TUTS\AngularJS 2 Essential Training\Angular- Learn with 10 example\AngularWeekend\templatestore\node_modules\http-server\bin\http-server:159:19)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
npm ERR! angular-seed#0.0.0 start: `http-server -a localhost -p 8000 -c-1 ./app`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the angular-seed#0.0.0 start script.
npm ERR! This is most likely a problem with the angular-seed package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! http-server -a localhost -p 8000 -c-1 ./app
npm ERR! You can get their info via:
npm ERR! npm owner ls angular-seed
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej s\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! cwd F:\0-TUTS\AngularJS 2 Essential Training\Angular- Learn with 10 exa mple\AngularWeekend\templatestore
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm
Adding the npm.debug.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 npm#1.4.9
3 info using node#v0.10.28
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart angular-seed#0.0.0
6 verbose unsafe-perm in lifecycle true
7 info start angular-seed#0.0.0
8 verbose unsafe-perm in lifecycle true
9 info angular-seed#0.0.0 Failed to exec start script
10 error angular-seed#0.0.0 start: `http-server -a localhost -p 8080 -c-1 ./app`
10 error Exit status 8
11 error Failed at the angular-seed#0.0.0 start script.
11 error This is most likely a problem with the angular-seed package,
11 error not with npm itself.
11 error Tell the author that this fails on your system:
11 error http-server -a localhost -p 8080 -c-1 ./app
11 error You can get their info via:
11 error npm owner ls angular-seed
11 error There is likely additional logging output above.
12 error System Windows_NT 6.2.9200
13 error command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
14 error cwd F:\0-TUTS\AngularJS 2 Essential Training\Angular- Learn with 10 example\AngularWeekend\templatestore
15 error node -v v0.10.28
16 error npm -v 1.4.9
17 error code ELIFECYCLE
18 verbose exit [ 1, true ]

netcdf doesn't work in Node.js program

I'm trying to encode a NetCDF file in Node.js program, by using the netcdf(https://www.npmjs.com/package/netcdf) library.
Now, once I run a program, I get an error below.
C:\app [master +2 ~1 -0 !]> npm start
> spaceapps#1.0.0 start C:\app
> node server.js
C:\app\node_modules\text-encoding\lib\encoding.js:979
throw TypeError('Called as a function. Did you forget \'new\'?');
^
TypeError: Called as a function. Did you forget 'new'?
at TypeError (native)
at Object.TextDecoder (C:\app\node_modules\text-encoding\lib\encoding.js:979:13)
at Object.<anonymous> (C:\app\node_modules\netcdf\util\readbinary.js:4:40)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (C:\app\node_modules\netcdf\util\type.js:4:14)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\Nodist\\v\\nodev5.9.1\\node.exe" "C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v5.9.1
npm ERR! npm v3.8.7
npm ERR! code ELIFECYCLE
npm ERR! spaceapps#1.0.0 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the spaceapps#1.0.0 start script 'node server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the spaceapps package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs spaceapps
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls spaceapps
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\app\npm-debug.log
C:\app [master +3 ~1 -0 !]>
It seems there is an error in a library.
I appreciate if someone tells me a solution for it.
As the developer said, He has no plans in the short or medium term to continue development, so you could consider use netcdfjs, that it's a javascript library that allows to read NetCDF v3 files. Because it's a NodeJS package you can run it server side, and for regular size files you can read it online, here you have an example.

Error in "npm start" command of angular seed cloning

I am getting the below error when i clone the angular seed from github and run the node server. I have cloned the angular seed to the existing project directory. I am not sure what is going wrong. But i am getting the below error. Kindly help
$ npm start
> StickyTodos#0.0.0 prestart C:\projects\StickyTodos
> npm install
> StickyTodos#0.0.0 postinstall C:\projects\StickyTodos
> bower install
> StickyTodos#0.0.0 start C:\projects\StickyTodos
> http-server -a localhost -p 8000 -c-1
events.js:141
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 127.0.0.1:8000
at Object.exports._errnoException (util.js:860:11)
at exports._exceptionWithHostPort (util.js:883:20)
at Server._listen2 (net.js:1234:14)
at listen (net.js:1270:10)
at net.js:1379:9
at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:63:16)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:82:10)
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v5.0.0
npm ERR! npm v2.10.1
npm ERR! code ELIFECYCLE
npm ERR! StickyTodos#0.0.0 start: `http-server -a localhost -p 8000 -c-1`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the StickyTodos#0.0.0 start script 'http-server -a localhost -p 8000 -c-1'.
npm ERR! This is most likely a problem with the StickyTodos package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! http-server -a localhost -p 8000 -c-1
npm ERR! You can get their info via:
npm ERR! npm owner ls StickyTodos
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\projects\StickyTodos\npm-debug.log
The error Error: listen EADDRINUSE 127.0.0.1:8000 is explaining that something is already bound to port 8000.
As you are on Windows, running netstat -a -b in an elevated command prompt (Right click start button and press Command Prompt (Admin)) should show you what is already listening to port 8000.
Simply stop that process, or alternatively bind to a different port which is free.

Categories

Resources