node-gyp error while doing npm install on a project - node.js

Apologies if this is a bit basic, I'm new but I've tried my best to resolve this to no avail and I really need this as part of training for my new job so any help is greatly appreciated.
I'm trying to load the project found on this git repository: https://github.com/taylonr/intro-to-protractor
The first part of installing protractor went without a hitch but when I tried loading the dependencies for the project I ran into issues.
Other info:
Windows 10
Node.js 4.2.3
Python v2.7.1
Visual Studio Community 2015
npm 3.5.2 (when I do npm -v)
node-gyp 3.2.1
What I've tried:
Initially had warnings regarding deprecated packages so updated those
npm config set msvs_version=2015 --global (that seemed to be causing some folks issues)
,
crhistian#crhistian-HP /cygdrive/c/users/crhistian/webstormprojects/intro-to-pro tractor
$ npm install
> v8-debug#0.4.6 preinstall C:\users\crhistian\webstormprojects\intro-to-protrac tor\node_modules\.staging\v8-debug-641e94fa
>
npm WARN prefer global node-inspector#0.9.2 should be installed with -g
> v8-debug#0.4.6 install C:\users\crhistian\webstormprojects\intro-to-protractor \node_modules\v8-debug
> node-pre-gyp install --fallback-to-build
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\v8-debug>if not defined npm_config_node_gyp (node "C:\Users\crhistian\AppData\Roaming\npm\n ode_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" c lean ) else (node clean )
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\v8-debug>if not defined npm_config_node_gyp (node "C:\Users\crhistian\AppData\Roaming\npm\n ode_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" c onfigure --fallback-to-build --module=C:\users\crhistian\webstormprojects\intro- to-protractor\node_modules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64\debug. node --module_name=debug --module_path=C:\users\crhistian\webstormprojects\intro -to-protractor\node_modules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64 --pyt hon=python --msvs_version=2015 ) else (node configure --fallback-to-build --mo dule=C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\v8-deb ug\build\debug\v0.4.6\node-v46-win32-x64\debug.node --module_name=debug --module _path=C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\v8-de bug\build\debug\v0.4.6\node-v46-win32-x64 --python=python --msvs_version=2015 )
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\v8-debug>if not defined npm_config_node_gyp (node "C:\Users\crhistian\AppData\Roaming\npm\n ode_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" b uild --fallback-to-build --module=C:\users\crhistian\webstormprojects\intro-to-p rotractor\node_modules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64\debug.node --module_name=debug --module_path=C:\users\crhistian\webstormprojects\intro-to- protractor\node_modules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64 ) else ( node build --fallback-to-build --module=C:\users\crhistian\webstormprojects\int ro-to-protractor\node_modules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64\deb ug.node --module_name=debug --module_path=C:\users\crhistian\webstormprojects\in tro-to-protractor\node_modules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64 )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
debug.cc
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(2 63): error C2995: 'v8::Local<T> _NanEnsureLocal(v8::Local<T>)': function templat e has already been defined [C:\users\crhistian\webstormprojects\intro-to-protrac tor\node_modules\v8-debug\build\debug.vcxproj]
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h (256): note: see declaration of '_NanEnsureLocal'
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6 61): error C3083: 'smalloc': the symbol to the left of a '::' must be a type [C: \users\crhistian\webstormprojects\intro-to-protractor\node_modules\v8-debug\buil d\debug.vcxproj]
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6 61): error C2039: 'FreeCallback': is not a member of 'node' [C:\users\crhistian\ webstormprojects\intro-to-protractor\node_modules\v8-debug\build\debug.vcxproj]
C:\Users\crhistian\.node-gyp\4.2.3\include\node\node_object_wrap.h(8): note: s ee declaration of 'node'
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6 61): error C2061: syntax error: identifier 'FreeCallback' [C:\users\crhistian\we bstormprojects\intro-to-protractor\node_modules\v8-debug\build\debug.vcxproj]
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6 65): error C2065: 'callback': undeclared identifier [C:\users\crhistian\webstorm projects\intro-to-protractor\node_modules\v8-debug\build\debug.vcxproj]
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6 65): error C2065: 'hint': undeclared identifier [C:\users\crhistian\webstormproj ects\intro-to-protractor\node_modules\v8-debug\build\debug.vcxproj]
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6 72): error C2665: 'node::Buffer::New': none of the 4 overloads could convert all the argument types [C:\users\crhistian\webstormprojects\intro-to-protractor\nod e_modules\v8-debug\build\debug.vcxproj]
C:\Users\crhistian\.node-gyp\4.2.3\include\node\node_buffer.h(43): note: could be 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate *,char *,size_t)'
C:\Users\crhistian\.node-gyp\4.2.3\include\node\node_buffer.h(31): note: or 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate *,v8::Local<v8::St ring>,node::encoding)'
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h (672): note: while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6 76): error C2440: 'return': cannot convert from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object>' [C:\users\crhistian\webstormprojects\intro-to-protractor \node_modules\v8-debug\build\debug.vcxproj]
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h (676): note: No constructor could take the source type, or constructor overload resolution was ambiguous
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6 83): error C2039: 'Use': is not a member of 'node::Buffer' [C:\users\crhistian\w ebstormprojects\intro-to-protractor\node_modules\v8-debug\build\debug.vcxproj]
C:\Users\crhistian\.node-gyp\4.2.3\include\node\node_buffer.h(8): note: see de claration of 'node::Buffer'
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6 83): error C3861: 'Use': identifier not found [C:\users\crhistian\webstormprojec ts\intro-to-protractor\node_modules\v8-debug\build\debug.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` fail ed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\crhistian\AppData\Roaming\np m\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces s.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\crhistian\\Ap pData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js " "build" "--fallback-to-build" "--module=C:\\users\\crhistian\\webstormprojects \\intro-to-protractor\\node_modules\\v8-debug\\build\\debug\\v0.4.6\\node-v46-wi n32-x64\\debug.node" "--module_name=debug" "--module_path=C:\\users\\crhistian\\ webstormprojects\\intro-to-protractor\\node_modules\\v8-debug\\build\\debug\\v0. 4.6\\node-v46-win32-x64"
gyp ERR! cwd C:\users\crhistian\webstormprojects\intro-to-protractor\node_module s\v8-debug
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback- to-build --module=C:\users\crhistian\webstormprojects\intro-to-protractor\node_m odules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64\debug.node --module_name=d ebug --module_path=C:\users\crhistian\webstormprojects\intro-to-protractor\node_ modules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\crhistian\Webs tormProjects\intro-to-protractor\node_modules\node-pre-gyp\lib\util\compile.js:8 3:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:818:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/chi ld_process.js:211:5)
node-pre-gyp ERR! System Windows_NT 10.0.10586
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\crhi stian\\WebstormProjects\\intro-to-protractor\\node_modules\\node-pre-gyp\\bin\\n ode-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\users\crhistian\webstormprojects\intro-to-protractor\no de_modules\v8-debug
node-pre-gyp ERR! node -v v4.2.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.18
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\users\crhi stian\webstormprojects\intro-to-protractor\node_modules\v8-debug\build\debug\v0. 4.6\node-v46-win32-x64\debug.node --module_name=debug --module_path=C:\users\crh istian\webstormprojects\intro-to-protractor\node_modules\v8-debug\build\debug\v0 .4.6\node-v46-win32-x64' (1)
copperpitch#0.0.1 C:\users\crhistian\webstormprojects\intro-to-protractor
├─┬ bower#1.3.12
│ ├─┬ bower-registry-client#0.2.4
│ │ └─┬ request#2.51.0
│ │ └─┬ form-data#0.2.0
│ │ └── async#0.9.2
│ ├─┬ insight#0.4.3
│ │ └── async#0.9.2
│ └─┬ request#2.42.0
│ └─┬ form-data#0.1.4
│ └── async#0.9.2
├── UNMET PEER DEPENDENCY grunt#~0.4.0
├─┬ karma#0.12.37
│ ├─┬ chokidar#1.4.2
│ │ └─┬ readdirp#2.0.0
│ │ └── minimatch#2.0.10
│ ├─┬ connect#2.30.2
│ │ ├─┬ compression#1.5.2
│ │ │ ├─┬ accepts#1.2.13
│ │ │ │ └── negotiator#0.5.3
│ │ │ └─┬ compressible#2.0.6
│ │ │ └── mime-db#1.20.0
│ │ ├─┬ connect-timeout#1.6.2
│ │ │ ├── debug#2.2.0
│ │ │ └── ms#0.7.1
│ │ ├── cookie#0.1.3
│ │ ├── cookie-signature#1.0.6
│ │ ├─┬ csurf#1.8.3
│ │ │ ├── cookie#0.1.3
│ │ │ └── cookie-signature#1.0.6
│ │ ├─┬ debug#2.2.0
│ │ │ └── ms#0.7.1
│ │ ├─┬ errorhandler#1.4.2
│ │ │ ├─┬ accepts#1.2.13
│ │ │ │ ├─┬ mime-types#2.1.8
│ │ │ │ │ └── mime-db#1.20.0
│ │ │ │ └── negotiator#0.5.3
│ │ │ └── escape-html#1.0.2
│ │ ├─┬ finalhandler#0.4.0
│ │ │ ├─┬ debug#2.2.0
│ │ │ │ └── ms#0.7.1
│ │ │ └── escape-html#1.0.2
│ │ ├── fresh#0.3.0
│ │ ├─┬ method-override#2.3.5
│ │ │ └── methods#1.1.1
│ │ ├── parseurl#1.3.0
│ │ ├── qs#4.0.0
│ │ ├─┬ serve-favicon#2.3.0
│ │ │ ├── fresh#0.3.0
│ │ │ ├── ms#0.7.1
│ │ │ └── parseurl#1.3.0
│ │ ├─┬ serve-index#1.7.2
│ │ │ ├─┬ accepts#1.2.13
│ │ │ │ └── negotiator#0.5.3
│ │ │ ├─┬ debug#2.2.0
│ │ │ │ └── ms#0.7.1
│ │ │ ├── escape-html#1.0.2
│ │ │ ├─┬ mime-types#2.1.8
│ │ │ │ └── mime-db#1.20.0
│ │ │ └── parseurl#1.3.0
│ │ ├─┬ serve-static#1.10.0
│ │ │ ├── escape-html#1.0.2
│ │ │ └─┬ send#0.13.0
│ │ │ ├── mime#1.3.4
│ │ │ └── range-parser#1.0.3
│ │ └─┬ type-is#1.6.10
│ │ └── mime-types#2.1.8
│ ├── mime#1.3.4
│ └── minimatch#2.0.10
├─┬ karma-coverage#0.2.7
│ └─┬ istanbul#0.3.22
│ └─┬ fileset#0.2.1
│ └── minimatch#2.0.10
└─┬ mongoose#3.8.37
└─┬ mquery#1.6.1
└─┬ debug#2.2.0
└── ms#0.7.1
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fseve nts#1.0.6
npm WARN grunt-concurrent#0.5.0 requires a peer of grunt#~0.4.0 but none was ins talled.
npm WARN grunt-contrib-csslint#0.2.0 requires a peer of grunt#~0.4.0 but none wa s installed.
npm WARN grunt-contrib-cssmin#0.9.0 requires a peer of grunt#~0.4.1 but none was installed.
npm WARN grunt-contrib-jshint#0.10.0 requires a peer of grunt#~0.4.0 but none wa s installed.
npm WARN grunt-contrib-uglify#0.4.1 requires a peer of grunt#~0.4.0 but none was installed.
npm WARN grunt-contrib-watch#0.6.1 requires a peer of grunt#~0.4.0 but none was installed.
npm WARN grunt-karma#0.8.3 requires a peer of grunt#0.4.x but none was installed .
npm WARN grunt-nodemon#0.2.1 requires a peer of grunt#~0.4.1 but none was instal led.
npm WARN grunt-node-inspector#0.1.6 requires a peer of grunt#~0.4.2 but none was installed.
npm WARN copperpitch#0.0.1 No repository field.
npm WARN copperpitch#0.0.1 No license field.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\crhistian\\AppDa ta\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.2.3
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! v8-debug#0.4.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the v8-debug#0.4.6 install script 'node-pre-gyp install --fal lback-to-build'.
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 v8-debug package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs v8-debug
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls v8-debug
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\users\crhistian\webstormprojects\intro-to-protractor\npm-debug.l og

In a similar post, someone tried specifying the build tools:
npm install protractor -g --msvs_version=2012
Seemed to do the trick.

Related

How to resolve npm vulnerability with npm as the dependent package involved?

So I run npm audit and all of the vulnerabilities are due to some dependency in npm, particularly node-gyp which is using a vulnerable version of tar. Note that I don’t have node-gyp in my package.json.
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Arbitrary File Overwrite │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ tar │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=2.2.2 <3.0.0 || >=4.4.2 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ npm │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ npm > npm-lifecycle > node-gyp > tar │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/803 │
└───────────────┴──────────────────────────────────────────────────────────────┘
I tried updating to the latest version of npm but I still get the same audit report. It’s quite nested. How do I resolve this?

AWS EB deployment issue "Failed to run npm install"

I'm trying to deploy a Node.js app to EB. The problem is, I'm getting the error on my EB dashboard, "Update environment operation is complete, but with errors.", and my app isn't running.
So I fetched the error log for my instance:
i-0d5cffacd74ddf4dc Severe 5 hours 2 - - - - - - - - - - 0.00 0.00 0.0 0.0 100 0.0
Application deployment failed at 2017-11-26T17:43:27Z with exit status 1 and error: Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh failed.
+ /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install
npm WARN lifecycle node#9.2.0~preinstall: cannot run in wd %s %s (wd=%s) node#9.2.0 node installArchSpecificPackage /tmp/deployment/application/node_modules/.staging/node-2356d873
Portfolio#0.0.1 /tmp/deployment/application
├─┬ body-parser#1.18.2
│ ├── bytes#3.0.0
│ ├── content-type#1.0.4
│ ├─┬ debug#2.6.9
│ │ └── ms#2.0.0
│ ├── depd#1.1.1
│ ├─┬ http-errors#1.6.2
│ │ ├── inherits#2.0.3
│ │ ├── setprototypeof#1.0.3
│ │ └── statuses#1.4.0
│ ├── iconv-lite#0.4.19
│ ├─┬ on-finished#2.3.0
│ │ └── ee-first#1.1.1
│ ├── qs#6.5.1
│ ├─┬ raw-body#2.3.2
│ │ └── unpipe#1.0.0
│ └─┬ type-is#1.6.15
│ ├── media-typer#0.3.0
│ └─┬ mime-types#2.1.17
│ └── mime-db#1.30.0
├─┬ express#4.16.2
│ ├─┬ accepts#1.3.4
│ │ └── negotiator#0.6.1
│ ├── array-flatten#1.1.1
│ ├── content-disposition#0.5.2
│ ├── cookie#0.3.1
│ ├── cookie-signature#1.0.6
│ ├── encodeurl#1.0.1
│ ├── escape-html#1.0.3
│ ├── etag#1.8.1
│ ├─┬ finalhandler#1.1.0
│ │ └── statuses#1.3.1
│ ├── fresh#0.5.2
│ ├── merge-descriptors#1.0.1
│ ├── methods#1.1.2
│ ├── parseurl#1.3.2
│ ├── path-to-regexp#0.1.7
│ ├─┬ proxy-addr#2.0.2
│ │ ├── forwarded#0.1.2
│ │ └── ipaddr.js#1.5.2
│ ├── range-parser#1.2.0
│ ├── safe-buffer#5.1.1
│ ├─┬ send#0.16.1
│ │ ├── destroy#1.0.4
│ │ ├── mime#1.4.1
│ │ └── statuses#1.3.1
│ ├── serve-static#1.13.1
│ ├── setprototypeof#1.1.0
│ ├── statuses#1.3.1
│ ├── utils-merge#1.0.1
│ └── vary#1.1.2
└── nodemailer#4.4.0
npm ERR! Linux 4.9.58-18.55.amzn1.x86_64
npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v6.11.5-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.11.5-linux-x64/bin/npm" "--production" "install"
npm ERR! node v6.11.5
npm ERR! npm v3.10.10
npm ERR! path /tmp/deployment/application/node_modules/node/bin/node
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/deployment/application/node_modules/node/bin/node'
npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/deployment/application/node_modules/node/bin/node'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /tmp/deployment/application/npm-debug.log
Running npm install: /opt/elasticbeanstalk/node-install/node-v6.11.5-linux-x64/bin/npm
Setting npm config jobs to 1
npm config jobs set to 1
Running npm with --production flag
Failed to run npm install. Snapshot logs for more details.
Traceback (most recent call last):
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 695, in <module>
main()
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 677, in main
node_version_manager.run_npm_install(options.app_path)
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 136, in run_npm_install
self.npm_install(bin_path, self.config_manager.get_container_config('app_staging_dir'))
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
raise e
subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v6.11.5-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 254.
Incorrect application version "Deploy5" (deployment 2). Expected version "Deploy06" (deployment 3).
In the midst of it all, I find Failed to run npm install. Snapshot logs for more details. Why does this happen? My app runs perfectly fine locally - why can't it run on aws?
File structure:
.zip
node_modules/
public/
app.js
package.json

How do I fix this gyp rebuild error when trying to install nodegit?

I'm trying to install the nodegit module on my Windows 7 machine. Here are the relevant versions of some things I have installed, let me know if anything else would be helpful:
Windows 7
python v2.7
node v4.2.0 (I switched to 32-bit node)
Previously the line that reads:
gyp ERR! stack Error: 404 status code downloading 64-bit node.lib
said (when I had 64-bit node installed):
gyp ERR! stack Error: 404 status code downloading 32-bit node.lib
I thought maybe it was trying to say that it couldn't find the 32-bit version of node, so I removed by 64-bit version and downloaded the 32-bit version. Now it references the 404 error in reference to the 64-bit node.
I'm thinking this may be an issue of incompatible versions, but I'm very new to node so I am at a loss. Any help would be greatly appreciated, here is the error I'm getting when I try to run "npm install nodegit":
> nodegit#0.4.1 install C:\code\node_modules\nodegit
> node lifecycleScripts/install
[nodegit] Fetching binary from S3.
[nodegit] Failed to install prebuilt binary, building manually.
[nodegit] Making sure dependencies are available and native code is generated
[nodegit] Something is missing, retrieving dependencies and regenerating code
promisify-node#0.1.5 node_modules\promisify-node
└── nodegit-promise#1.0.2 (asap#1.0.0)
combyne#0.8.1 node_modules\combyne
nan#1.9.0 node_modules\nan
fs-extra#0.18.4 node_modules\fs-extra
├── jsonfile#2.2.3
├── graceful-fs#3.0.8
└── rimraf#2.5.2 (glob#7.0.0)
js-beautify#1.6.2 node_modules\js-beautify
├── config-chain#1.1.10 (ini#1.3.4, proto-list#1.2.4)
├── nopt#3.0.6 (abbrev#1.0.7)
└── mkdirp#0.5.1 (minimist#0.0.8)
mocha#2.4.5 node_modules\mocha
├── escape-string-regexp#1.0.2
├── commander#2.3.0
├── growl#1.8.1
├── diff#1.4.0
├── supports-color#1.2.0
├── debug#2.2.0 (ms#0.7.1)
├── mkdirp#0.5.1 (minimist#0.0.8)
├── glob#3.2.3 (inherits#2.0.1, graceful-fs#2.0.3, minimatch#0.2.14)
└── jade#0.26.3 (commander#0.6.1, mkdirp#0.3.0)
request#2.69.0 node_modules\request
├── aws-sign2#0.6.0
├── forever-agent#0.6.1
├── tunnel-agent#0.4.2
├── is-typedarray#1.0.0
├── oauth-sign#0.8.1
├── caseless#0.11.0
├── stringstream#0.0.5
├── isstream#0.1.2
├── json-stringify-safe#5.0.1
├── extend#3.0.0
├── tough-cookie#2.2.1
├── qs#6.0.2
├── node-uuid#1.4.7
├── mime-types#2.1.10 (mime-db#1.22.0)
├── combined-stream#1.0.5 (delayed-stream#1.0.0)
├── form-data#1.0.0-rc3 (async#1.5.2)
├── aws4#1.3.1 (lru-cache#4.0.0)
├── bl#1.0.3 (readable-stream#2.0.5)
├── hawk#3.1.3 (cryptiles#2.0.5, boom#2.10.1, sntp#1.0.9, hoek#2.16.3)
├── http-signature#1.1.1 (assert-plus#0.2.0, jsprim#1.2.2, sshpk#1.7.4)
└── har-validator#2.0.6 (pinkie-promise#2.0.0, commander#2.9.0, chalk#1.1.1, i
my-json-valid#2.13.1)
tar#2.2.1 node_modules\tar
├── inherits#2.0.1
├── block-stream#0.0.8
└── fstream#1.0.8 (graceful-fs#4.1.3, mkdirp#0.5.1, rimraf#2.5.2)
lcov-result-merger#1.0.2 node_modules\lcov-result-merger
├── vinyl#0.4.6 (clone-stats#0.0.1, clone#0.2.0)
├── through2#0.6.5 (xtend#4.0.1, readable-stream#1.0.33)
└── vinyl-fs#0.3.14 (graceful-fs#3.0.8, defaults#1.0.3, strip-bom#1.0.0, mkdir
0.5.1, glob-stream#3.1.18, glob-watcher#0.0.6)
coveralls#2.11.8 node_modules\coveralls
├── lcov-parse#0.0.6
├── log-driver#1.2.4
├── minimist#1.2.0
├── js-yaml#3.0.1 (esprima#1.0.4, argparse#0.1.16)
└── request#2.67.0 (aws-sign2#0.6.0, forever-agent#0.6.1, tunnel-agent#0.4.2,
uth-sign#0.8.1, caseless#0.11.0, is-typedarray#1.0.0, stringstream#0.0.5, isst
am#0.1.2, json-stringify-safe#5.0.1, extend#3.0.0, tough-cookie#2.2.1, qs#5.2.
node-uuid#1.4.7, combined-stream#1.0.5, mime-types#2.1.10, form-data#1.0.0-rc
bl#1.0.3, hawk#3.1.3, http-signature#1.1.1, har-validator#2.0.6)
nw- gyp#0.12.4 node_modules\nw- gyp
├── graceful-fs#2.0.3
├── semver#2.2.1
├── osenv#0.1.3 (os-tmpdir#1.0.1, os-homedir#1.0.1)
├── minimatch#0.4.0 (sigmund#1.0.1, lru-cache#2.7.3)
├── nopt#2.2.1 (abbrev#1.0.7)
├── npmlog#0.1.1 (ansi#0.3.1)
├── fstream#0.1.31 (inherits#2.0.1, graceful-fs#3.0.8)
├── which#1.2.4 (isexe#1.1.2, is-absolute#0.1.7)
├── mkdirp#0.5.1 (minimist#0.0.8)
├── tar#0.1.20 (inherits#2.0.1, block-stream#0.0.8)
├── glob#3.2.11 (inherits#2.0.1, minimatch#0.3.0)
└── rimraf#2.5.2 (glob#7.0.0)
pan gyp#2.3.3 node_modules\pan gyp
├── which#1.0.9
├── graceful-fs#3.0.8
├── rimraf#2.2.8
├── osenv#0.1.3 (os-homedir#1.0.1, os-tmpdir#1.0.1)
├── semver#4.3.6
├── nopt#3.0.6 (abbrev#1.0.7)
├── fstream#1.0.8 (inherits#2.0.1, graceful-fs#4.1.3)
├── glob#4.3.5 (inherits#2.0.1, once#1.3.3, inflight#1.0.4)
├── minimatch#2.0.10 (brace-expansion#1.1.3)
├── mkdirp#0.5.1 (minimist#0.0.8)
├── tar#1.0.3 (inherits#2.0.1, block-stream#0.0.8)
├── npmlog#1.0.0 (ansi#0.3.1, gauge#1.0.2, are-we-there-yet#1.0.6)
└── request#2.51.0 (aws-sign2#0.5.0, forever-agent#0.5.2, caseless#0.8.0, oaut
sign#0.5.0, tunnel-agent#0.4.2, stringstream#0.0.5, json-stringify-safe#5.0.1,
ime-types#1.0.2, tough-cookie#2.2.1, qs#2.3.3, node-uuid#1.4.7, combined-strea
0.0.7, http-signature#0.10.1, form-data#0.2.0, bl#0.9.5, hawk#1.1.1)
lodash#3.10.1 node_modules\lodash
jshint#2.9.1 node_modules\jshint
├── strip-json-comments#1.0.4
├── exit#0.1.2
├── console-browserify#1.1.0 (date-now#0.1.4)
├── minimatch#2.0.10 (brace-expansion#1.1.3)
├── shelljs#0.3.0
├── cli#0.6.6 (glob#3.2.11)
├── htmlparser2#3.8.3 (domelementtype#1.3.0, entities#1.0.0, domhandler#2.3.0,
eadable-stream#1.1.13, domutils#1.5.1)
└── lodash#3.7.0
istanbul#0.3.22 node_modules\istanbul
├── abbrev#1.0.7
├── async#1.5.2
├── wordwrap#1.0.0
├── nopt#3.0.6
├── esprima#2.5.0
├── supports-color#3.1.2 (has-flag#1.0.0)
├── once#1.3.3 (wrappy#1.0.1)
├── which#1.2.4 (isexe#1.1.2, is-absolute#0.1.7)
├── mkdirp#0.5.1 (minimist#0.0.8)
├── fileset#0.2.1 (minimatch#2.0.10, glob#5.0.15)
├── resolve#1.1.7
├── escodegen#1.7.1 (estraverse#1.9.3, esutils#2.0.2, esprima#1.2.5, optionato
0.5.0, source-map#0.2.0)
├── js-yaml#3.5.3 (esprima#2.7.2, argparse#1.0.6)
└── handlebars#4.0.5 (optimist#0.6.1, source-map#0.4.4, uglify-js#2.6.2)
[nodegit] Detecting vendor/libgit2/fb6df50b7f250a4fd8b2fab257f119a5185e9bf5.
[nodegit] Detecting vendor/libssh2/1.4.3.
[nodegit] Detecting vendor/http_parser/2.5.0.
[nodegit] Detecting generated code.
[nodegit] vendor/libgit2/fb6df50b7f250a4fd8b2fab257f119a5185e9bf5 already exis
.
[nodegit] vendor/libssh2/1.4.3 already exists.
[nodegit] Generated code is intact.
[nodegit] Removing outdated vendor/http_parser/.
[nodegit] Retrieving vendor/http_parser/.
[nodegit] Successfully updated vendor/http_parser/2.5.0.
[nodegit] Everything is ready to go, attempting compilation
[nodegit] Building native node module.
{ [Error: Command failed: C:\Windows\system32\cmd.exe /s /c "C:\code\dpc\suppo
\node_modules\nodegit\node_modules\.bin\pan gyp rebuild"
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 status code downloading 64-bit node.lib
gyp ERR! stack at Request.<anonymous> (C:\code\dpc\support\node_modules\no
git\node_modules\pan gyp\lib\install.js:403:20)
gyp ERR! stack at emitOne (events.js:82:20)
gyp ERR! stack at Request.emit (events.js:169:7)
gyp ERR! stack at Request.onRequestResponse (C:\code\dpc\support\node_modu
s\nodegit\node_modules\pan gyp\node_modules\request\request.js:1255:10)
gyp ERR! stack at emitOne (events.js:77:13)
gyp ERR! stack at ClientRequest.emit (events.js:169:7)
gyp ERR! stack at HTTPParser.parserOnIncomingClient (_http_client.js:415:2
gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:88:2
gyp ERR! stack at Socket.socketOnData (_http_client.js:305:20)
gyp ERR! stack at emitOne (events.js:77:13)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\code\\dpc\\support
node_modules\\nodegit\\node_modules\\pan gyp\\bin\\node- gyp.js" "rebuild"
gyp ERR! cwd C:\code\dpc\support\node_modules\nodegit
gyp ERR! node -v v4.2.0
gyp ERR! pan gyp -v v2.3.3
gyp ERR! not ok
]
killed: false,
code: 1,
signal: null,
cmd: 'C:\\Windows\\system32\\cmd.exe /s /c "C:\\code\\dpc\\support\\node_mod
es\\nodegit\\node_modules\\.bin\\pan gyp rebuild"' }
undefined
#0.4.1 ..\node_modules\nodegit
├── nodegit-promise#2.0.1 (asap#2.0.3)
├── which-native-nodish#1.1.3 (find-parent-dir#0.3.0, nodegit-promise#1.0.2)
└── npm#2.14.21
I never really figured out why this didn't work, but for anyone else who sees this - what I ended up doing was npm install -g nodegit. Then I just copied the nodegit module from where npm was installed and that works.

Installing Cycle.js and running examples: enoent package.json file is missing

I don't have too much experience in NodeJs. I wanted to try Cyclejs. The documentation says:
Create a new directory and run this inside that directory:
npm install rx #cycle/core #cycle/dom
When I do this, I get the following warning:
➜ cycle-examples npm install rx #cycle/core #cycle/dom
/Users/mertnuhoglu/projects/js/tmp2/cycle-examples
├── #cycle/core#5.0.1
├─┬ #cycle/dom#7.1.1
│ ├─┬ es6-map#0.1.1
│ │ ├── d#0.1.1
│ │ ├─┬ es5-ext#0.10.8
│ │ │ ├── es6-iterator#2.0.0
│ │ │ └── es6-symbol#3.0.1
│ │ ├─┬ es6-iterator#0.1.3
│ │ │ └── es6-symbol#2.0.1
│ │ ├─┬ es6-set#0.1.2
│ │ │ ├── es6-iterator#2.0.0
│ │ │ └── es6-symbol#3.0.1
│ │ ├── es6-symbol#0.1.1
│ │ └── event-emitter#0.3.4
│ ├── matches-selector#1.0.0
│ ├── vdom-parser#1.2.1
│ ├─┬ vdom-to-html#2.1.1
│ │ ├── escape-html#1.0.3
│ │ ├─┬ param-case#1.1.1
│ │ │ └─┬ sentence-case#1.1.2
│ │ │ └── lower-case#1.1.2
│ │ └── xtend#4.0.0
│ ├─┬ virtual-dom#2.1.1
│ │ ├── browser-split#0.0.1
│ │ ├─┬ error#4.4.0
│ │ │ ├── camelize#1.0.0
│ │ │ └── string-template#0.2.1
│ │ ├─┬ ev-store#7.0.0
│ │ │ └── individual#3.0.0
│ │ ├─┬ global#4.3.0
│ │ │ ├─┬ min-document#2.17.0
│ │ │ │ └── dom-walk#0.1.1
│ │ │ └── process#0.5.2
│ │ ├── is-object#1.0.1
│ │ ├── next-tick#0.2.2
│ │ └── x-is-string#0.1.0
│ └── x-is-array#0.1.0
└── rx#4.0.6
npm WARN ENOENT ENOENT, open '/Users/mertnuhoglu/projects/js/tmp2/cycle-examples/package.json'
npm WARN EPACKAGEJSON cycle-examples No description
npm WARN EPACKAGEJSON cycle-examples No repository field.
npm WARN EPACKAGEJSON cycle-examples No README data
npm WARN EPACKAGEJSON cycle-examples No license field.
After that I cloned cycle-examples and run npm start following the instructions. I get the following error:
➜ cycle-examples git clone https://github.com/cyclejs/cycle-examples
Cloning into 'cycle-examples'...
remote: Counting objects: 184, done.
remote: Total 184 (delta 0), reused 0 (delta 0), pack-reused 184
Receiving objects: 100% (184/184), 31.08 KiB | 0 bytes/s, done.
Resolving deltas: 100% (72/72), done.
Checking connectivity... done.
➜ cycle-examples npm start
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "start"
npm ERR! node v0.12.7
npm ERR! npm v3.3.8
npm ERR! path /Users/mertnuhoglu/projects/js/tmp2/cycle-examples/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! enoent ENOENT, open '/Users/mertnuhoglu/projects/js/tmp2/cycle-examples/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/mertnuhoglu/projects/js/tmp2/cycle-examples/npm-debug.log
The error says I need to have package.json. The git repository does not have it. Should I create it on my own? If so, what should I put inside that file?
npm version is 3.3.8
I have browserify#11.2.0 and babel#5.8.23 libraries installed globally in Node.
The cycle-examples is a collection of examples. You need to enter an actual example directory, e.g., bmi-nested, and from there issue npm start.

Cannot Install gulp-sass

I'm trying to learn how to use gulp / sass / and all the other fun tools with Nodejs and I'm having an issue installing gulp-sass. The process I'm using to install everything is:
1. Start Git Bash in the project folder
2. npm init
3. npm install gulp -g
4. npm install gulp --save-dev
5. npm install gulp-sass <- this is where I get errors
Once I get to step five, I get the following error:
$ npm install gulp-sass
npm WARN package.json project#1.0.0 No repository field.
npm WARN package.json project#1.0.0 No README data
-
> node-sass#3.2.0 install \\primary\home\mendsley\profile\Desktop\project\node_modules\gulp- sass\node_modules\node-sass
> node scripts/install.js
'\\primary\home\mendsley\profile\Desktop\project\node_modules\gulp- sass\node_modules\node-sass'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
module.js:338
throw err;
^
Error: Cannot find module 'C:\Windows\scripts\install.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Users\\mendsley\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "gulp-sass"
npm ERR! node v0.12.1
npm ERR! npm v2.13.1
npm ERR! code ELIFECYCLE
npm ERR! node-sass#3.2.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#3.2.0 install script 'node scripts/install.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! \\primary\home\mendsley\profile\Desktop\project\npm-debug.log
I'm trying this on my work computer, so I'm not sure if that matters. The system admin says there should not be any issue and other people have no issue with same package...and talking to them, they offer no help. I tried everything on my personal laptop and gulp-sass installs just fine, so it is something with my work pc.
My initial thought is it's a path issue, but then why do other packages install okay?
I did uninstall/reinstall Nodejs, but that didn't help.
Does anyone have an idea?
Thanks in advance!
Your first guess was good as it is a matter of path name. From the error message :
UNC paths are not supported. Defaulting to Windows directory.
Npm needed to access \\primary\home\mendsley\...\node_modules\node-sass so as to execute the gulp-sass installation script. But this path is a UNC path (Uniform Naming Convention) and therefore is not supported.
As a consequence, the npm command defaulted to C:/Windows instead and tries to execute the installation script of gulp-sass (install.js) but this script is, as you might guess, not present in this directory.
It could be a dependency hell problem with an older NodeJS or NPM version, too. gulp-sass depends on node-sass, which in turn depends on other packages, and they also depend on the right NodeJS and NPM version. For version 0.7.3 the full dependencies look like this:
├─┬ gulp-sass#0.7.3
│ ├── map-stream#0.1.0
│ └─┬ node-sass#0.9.6
│ ├─┬ chalk#0.5.1
│ │ ├── ansi-styles#1.1.0
│ │ ├── escape-string-regexp#1.0.3
│ │ ├─┬ has-ansi#0.1.0
│ │ │ └── ansi-regex#0.2.1
│ │ ├─┬ strip-ansi#0.3.0
│ │ │ └── ansi-regex#0.2.1
│ │ └── supports-color#0.2.0
│ ├── get-stdin#3.0.2
│ ├─┬ mkdirp#0.5.1
│ │ └── minimist#0.0.8
│ ├─┬ mocha#1.21.5
│ │ ├── commander#2.3.0
│ │ ├─┬ debug#2.0.0
│ │ │ └── ms#0.6.2
│ │ ├── diff#1.0.8
│ │ ├── escape-string-regexp#1.0.2
│ │ ├─┬ glob#3.2.3
│ │ │ ├── graceful-fs#2.0.3
│ │ │ ├── inherits#2.0.1
│ │ │ └─┬ minimatch#0.2.14
│ │ │ ├── lru-cache#2.7.3
│ │ │ └── sigmund#1.0.1
│ │ ├── growl#1.8.1
│ │ ├─┬ jade#0.26.3
│ │ │ ├── commander#0.6.1
│ │ │ └── mkdirp#0.3.0
│ │ └─┬ mkdirp#0.5.0
│ │ └── minimist#0.0.8
│ ├── nan#1.3.0
│ ├── node-sass-middleware#0.3.1
│ ├── node-watch#0.3.5
│ ├── object-assign#1.0.0
│ ├─┬ sinon#1.10.3
│ │ ├─┬ formatio#1.0.2
│ │ │ └── samsam#1.1.3
│ │ └─┬ util#0.10.3
│ │ └── inherits#2.0.1
│ └── yargs#1.3.3
I had trouble to install version 0.7.3 of gulp-sass with the latest versions of NodeJS 5.2.0 and NPM 3.5.2. This older version of gulp-sass worked only with the older version of NodeJS 0.12.9 and NPM 2.14.9, see also https://github.com/sass/node-sass/issues/1166
Look at this:
"CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory."
You can use the pushd command. As example for --global Installation for a domain user on network share:
pushd \\server\yourpath\user\AppData\Roaming\npm
hint: you could figure out the right path for global npm installations by using %appdata%\npm in your Explorer, the cmd answers:
Z:\user\AppData\Roaming\npm>
now you can type "npm install node-sass" (or gulp-sass or whatever)
Z:\user\AppData\Roaming\npm>npm install node-sass
without --global or -g, in this path you are "global"
if finished, then popd to disconnect the Z:
I had the same issue and I fixed it with simple step.
The real problem is with autorun to set the path of your command prompt. It is related to your registry.
i just deleted the autorun file in registry for command processor and it started working normally.
Hop in this link

Resources