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

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.

Related

How do I tell npm to install specific version of library?

As a part of security vulnerability fix, I need update one of the transitive dependency.
The vulnerability is in minimist package, which needs to be updated to 0.2.1.
minimist :: 0.0.8 >> Mypackage >> node:npm:artifactory/npm-dcloud:less:3.9.0 >> node:npm:artifactory/npm-dcloud:mkdirp:0.5.1
This is how the vulnerable package is reported in my system.So I need to tell less:3.9.0 that it should use specific version of minimist when it is fetched in one of its dependencies from mkdirp.
As of now my package.json looks like:
"dependencies": {
.......
.......
"less": "^3.0.4",
.......
}
I have two queries here:
Why does package-lock.json has less version as 3.9.0 when I have 3.0.4 in package.json?In npm list also, I see only 3.9.0.
How can I inform npm to use minimist 0.2.1 instead 0.0.8 as reported above?
npm ls minimist
├─┬ babel-cli#6.26.0
│ └─┬ chokidar#1.7.0
│ └─┬ fsevents#1.1.3
│ └─┬ node-pre-gyp#0.6.39
│ ├─┬ mkdirp#0.5.1
│ │ └── minimist#0.0.8
│ └─┬ rc#1.2.1
│ └── minimist#1.2.0
├─┬ babel-loader#7.1.5
│ └─┬ mkdirp#0.5.1
│ └── minimist#0.0.8
├─┬ grunt#1.0.1
│ └─┬ dateformat#1.0.12
│ └─┬ meow#3.7.0
│ └── minimist#1.2.0
├─┬ karma#1.5.0
│ └─┬ optimist#0.6.1
│ └── minimist#0.0.10
├─┬ karma-mocha#1.3.0
│ └── minimist#1.2.0
├── minimist#0.2.1
├─┬ phantomjs-prebuilt#2.1.16
│ └─┬ extract-zip#1.6.6
│ └─┬ mkdirp#0.5.0
│ └── minimist#0.0.8
├─┬ UNMET PEER DEPENDENCY webpack#3.12.0
│ └─┬ watchpack#1.6.0
│ └─┬ chokidar#2.0.4
│ └─┬ fsevents#1.2.4
│ └─┬ node-pre-gyp#0.10.0
│ ├─┬ mkdirp#0.5.1
│ │ └── minimist#0.0.8
│ └─┬ rc#1.2.7
│ └── minimist#1.2.0
└─┬ webpack-dev-server#2.9.7
└─┬ internal-ip#1.2.0
└─┬ meow#3.7.0
└── minimist#1.2.0
npm ERR! peer dep missing: webpack#^2.1.0-beta || ^2.2.0-rc || ^2.0.0, required by grunt-webpack#2.0.1
npm ERR! peer dep missing: webpack#^1.1.0 || ^2 || ^2.1.0-beta.0 || ^2.2.0-rc.0, required by karma-webpack#2.0.3
I have tried overrides as mentioned
https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides
as follow:
"overrides": {
"mkdirp": {
"minimist": "0.2.1"
}
but still minimist older version is coming
Second query:
rm -rf node_modules/
rm package-lock.json
In the package.json file it is possible to add the transitive dependency version.
"resolutions": {
"minimist": "0.2.1"
},
npm install
:)
npm install module_name#version_number
npm install less#3.0.4

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

npm cant find package.json when installing react

This is a followup question to my earlier question (but is an independent question)
I am trying to install react and react-dom on a Mac:
npm install --save react react-dom
but get the following warnings (path names replaced with ...):
npm WARN saveError ENOENT: no such file or directory, open '/Users/../Z/package.json'
/Users/.../Z
├─┬ react#15.4.1
│ ├─┬ fbjs#0.8.8
│ │ ├── core-js#1.2.7
│ │ ├─┬ isomorphic-fetch#2.2.1
│ │ │ ├─┬ node-fetch#1.6.3
│ │ │ │ ├─┬ encoding#0.1.12
│ │ │ │ │ └── iconv-lite#0.4.15
│ │ │ │ └── is-stream#1.1.0
│ │ │ └── whatwg-fetch#2.0.1
│ │ ├─┬ promise#7.1.1
│ │ │ └── asap#2.0.5
│ │ ├── setimmediate#1.0.5
│ │ └── ua-parser-js#0.7.12
│ ├─┬ loose-envify#1.3.0
│ │ └── js-tokens#2.0.0
│ └── object-assign#4.1.0
└── react-dom#15.4.1
npm WARN enoent ENOENT: no such file or directory, open '/Users/.../Z/package.json'
npm WARN Z No description
npm WARN Z No repository field.
npm WARN Z No README data
npm WARN Z No license field.
I searched around a bit but did not find a good reason for these warnings. SO posts like these seem to suggest installing react in the same directory where node modules are installed. My node is installed in usr/local/bin but package.json does not appear anywhere on the machine even on a global search. I just installed npm before trying to install react so don't think its a versioning issue.
If this is a brand new project, it can be resolved by running npm init from the root directory of your project (where you want package.json to be created), and press "ENTER" at all of the prompts to accept the default answers. (It is easy to change your responses by directly modifying the package.json file later.)
Once the package.json has been created, you will be able to run npm install commands!
Actually for me it just worked like this :
I ran npx create-react-app "nameOfProject" , if you type npm start in the same folder it won't work because it tries to find the package.json in the same folder , when your package.json is in the subfolder ( the folder of the "nameOfProject" ).
Run cd "nameOfProject" to change the directory and them run npm start .
Check the folder you're in. Usually after using npx create-react-app, you'll be in the same folder. you will be needed to cd into the new folder that is created after running above command. there you'll find package.json.

node-gyp error while doing npm install on a project

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.

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