Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Repository can't npm install #14200

Closed
zackhall opened this issue Mar 8, 2016 · 5 comments
Closed

Repository can't npm install #14200

zackhall opened this issue Mar 8, 2016 · 5 comments

Comments

@zackhall
Copy link

zackhall commented Mar 8, 2016

I'm on the Microsoft Edge web platform team and we're trying to automate Angular's tests in our browser. We're encounter multiple issues blocking an npm install on Windows.

The first issue is that with npm 3+ the preinstall script is running after the install and purging the node_modules folder. This is covered in bug #13123.

This can be mitigated by renaming the preinstall script and running it manually.

However, then after running npm i again Windows users will see node-gyp build issues.

zackhall@ZTH E:\github\ng\node_modules\bufferutil
> if not defined npm_config_node_gyp (node "C:\Users\zackhall\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  bufferutil.cc
E:\github\ng\node_modules\nan\nan.h(263): error C2995: 'v8::Local<T> _NanEnsureLocal(v8::Local<T>)' : function template has already b
een defined [E:\github\ng\node_modules\bufferutil\build\bufferutil.vcxproj]
          E:\github\ng\node_modules\nan\nan.h(256) : see declaration of '_NanEnsureLocal'
E:\github\ng\node_modules\nan\nan.h(661): error C3083: 'smalloc': the symbol to the left of a '::' must be a type [E:\github\ng\node_
modules\bufferutil\build\bufferutil.vcxproj]
E:\github\ng\node_modules\nan\nan.h(661): error C2039: 'FreeCallback' : is not a member of 'node' [E:\github\ng\node_modules\bufferut
il\build\bufferutil.vcxproj]
E:\github\ng\node_modules\nan\nan.h(661): error C2061: syntax error : identifier 'FreeCallback' [E:\github\ng\node_modules\bufferutil
\build\bufferutil.vcxproj]
E:\github\ng\node_modules\nan\nan.h(665): error C2065: 'callback' : undeclared identifier [E:\github\ng\node_modules\bufferutil\build
\bufferutil.vcxproj]
E:\github\ng\node_modules\nan\nan.h(665): error C2065: 'hint' : undeclared identifier [E:\github\ng\node_modules\bufferutil\build\buf
ferutil.vcxproj]
E:\github\ng\node_modules\nan\nan.h(672): error C2665: 'node::Buffer::New' : none of the 4 overloads could convert all the argument t
ypes [E:\github\ng\node_modules\bufferutil\build\bufferutil.vcxproj]
          C:\Users\zackhall\.node-gyp\5.7.1\include\node\node_buffer.h(43): could be 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8
  ::Isolate *,char *,size_t)'
          C:\Users\zackhall\.node-gyp\5.7.1\include\node\node_buffer.h(31): or       'v8::MaybeLocal<v8::Object> node::Buffer::New(v8
  ::Isolate *,v8::Local<v8::String>,node::encoding)'
          while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
E:\github\ng\node_modules\nan\nan.h(676): error C2664: 'v8::Local<v8::Object>::Local(const v8::Local<v8::Object> &)' : cannot convert
 argument 1 from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object> &' [E:\github\ng\node_modules\bufferutil\build\bufferut
il.vcxproj]
          Reason: cannot convert from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object>'
          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
E:\github\ng\node_modules\nan\nan.h(683): error C2039: 'Use' : is not a member of 'node::Buffer' [E:\github\ng\node_modules\bufferuti
l\build\bufferutil.vcxproj]
E:\github\ng\node_modules\nan\nan.h(683): error C3861: 'Use': identifier not found [E:\github\ng\node_modules\bufferutil\build\buffer
util.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\zackhall\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.14282
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\zackhall\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\github\ng\node_modules\bufferutil
gyp ERR! node -v v5.7.1
gyp ERR! node-gyp -v v3.3.0
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1

> [email protected] install E:\github\ng\node_modules\utf-8-validate
> node-gyp rebuild

> [email protected] install E:\github\ng\node_modules\utf-8-validate
> node-gyp rebuild


zackhall@ZTH E:\github\ng\node_modules\utf-8-validate
> if not defined npm_config_node_gyp (node "C:\Users\zackhall\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  validation.cc
E:\github\ng\node_modules\nan\nan.h(263): error C2995: 'v8::Local<T> _NanEnsureLocal(v8::Local<T>)' : function template has already been defined [E:\github\ng\node_modules\utf-8-validate\build\validation.vcxproj]
          E:\github\ng\node_modules\nan\nan.h(256) : see declaration of '_NanEnsureLocal'
E:\github\ng\node_modules\nan\nan.h(661): error C3083: 'smalloc': the symbol to the left of a '::' must be a type [E:\github\ng\node_modules\utf-8-validate\build\validation.vcxproj]
E:\github\ng\node_modules\nan\nan.h(661): error C2039: 'FreeCallback' : is not a member of 'node' [E:\github\ng\node_modules\utf-8-validate\build\validation.vcxproj]
E:\github\ng\node_modules\nan\nan.h(661): error C2061: syntax error : identifier 'FreeCallback' [E:\github\ng\node_modules\utf-8-validate\build\validation.vcxproj]
E:\github\ng\node_modules\nan\nan.h(665): error C2065: 'callback' : undeclared identifier [E:\github\ng\node_modules\utf-8-validate\build\validation.vcxproj]
E:\github\ng\node_modules\nan\nan.h(665): error C2065: 'hint' : undeclared identifier [E:\github\ng\node_modules\utf-8-validate\build\validation.vcxproj]
E:\github\ng\node_modules\nan\nan.h(672): error C2665: 'node::Buffer::New' : none of the 4 overloads could convert all the argument types [E:\github\ng\node_modules\utf-8-validate\build\validation.vcxproj]
          C:\Users\zackhall\.node-gyp\5.7.1\include\node\node_buffer.h(43): could be 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate *,char *,size_t)'
          C:\Users\zackhall\.node-gyp\5.7.1\include\node\node_buffer.h(31): or       'v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate *,v8::Local<v8::String>,node::encoding)'
          while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
E:\github\ng\node_modules\nan\nan.h(676): error C2664: 'v8::Local<v8::Object>::Local(const v8::Local<v8::Object> &)' : cannot convert argument 1 from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object> &' [E:\github\ng\node_module s\utf-8-validate\build\validation.vcxproj]
          Reason: cannot convert from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object>'
          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
E:\github\ng\node_modules\nan\nan.h(683): error C2039: 'Use' : is not a member of 'node::Buffer' [E:\github\ng\node_modules\utf-8-validate\build\validation.vcxproj]
E:\github\ng\node_modules\nan\nan.h(683): error C3861: 'Use': identifier not found [E:\github\ng\node_modules\utf-8-validate\build\validation.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\zackhall\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.14282
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\zackhall\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\github\ng\node_modules\utf-8-validate
gyp ERR! node -v v5.7.1
gyp ERR! node-gyp -v v3.3.0
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1

> angularjs@ postinstall E:\github\ng
> node scripts/npm/copy-npm-shrinkwrap.js

- npm-shrinkwrap.cached.json node_modules\npm-shrinkwrap.cached.json
npm WARN optional Skipping failed optional dependency /commitizen/babel/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm WARN optional Skipping failed optional dependency /commitizen/nodemon/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm WARN optional Skipping failed optional dependency /dgeni-packages/nunjucks/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm WARN optional Skipping failed optional dependency /karma/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]

I have tried the following among many other mitigations with no success.

  • Setting environment variable GYP_MSVS_VERSION=2015
  • Running: npm install -g --msvs_version=2015 node-gyp rebuild
  • npm config set msvs_version 2015 and with --global

Any help would be appreciated.

@gkalpak
Copy link
Member

gkalpak commented Mar 8, 2016

Regarding the first issue, our current setup is indeed not (yet) compatible with npm v3.x.
The work-around you describe will indeed solve one of the issues, but I am not sure if the versions of our dependencies are themselves compatibe with npm v3.x.

FWIW, node-gyp error (even if pretty bold and scary) don't necessarily mean that the installation failed (they are common on Windows). Are you sure that npm install failed ?

@gkalpak
Copy link
Member

gkalpak commented Mar 8, 2016

I will go ahead and close this since our current incompatibility with npm v3.x is tracked in another issue, but feel free to continue the discussion below.

You might also want to try your luck on one of the general support channels. Maybe someone has some experience with setting up Angular's development environment on npm v3.x.

@gkalpak gkalpak closed this as completed Mar 8, 2016
@zackhall
Copy link
Author

zackhall commented Mar 8, 2016

Thanks for your response, @gkalpak.

I tried to move forward from the npm install, despite the issues, and run grunt package then grunt test:e2e. Grunt package succeeded but the tests aren't running properly. The webdriver instance is spun up, and a new instance of Chrome is launched, but it just sits idly at data:,.

@gkalpak
Copy link
Member

gkalpak commented Mar 10, 2016

The fact that grunt package succeeded is an indication that npm install succeeded as well.
Good first step 😃

Now regarding the grunt test:e2e issue:

I've been running into this myself lately. It had something to do with our version of Protractor relying on an older version of ChromeDriver (that is somehow not compatible with certain combinations of Chrome and Windows versions and other unknown factors).

So, while we're dealing with this issue, you can
work around the problem by manually downloading the latest ChromeDriver and unzip it into node_modules/protractor/selenium (overwriting the existing chromedriver.exe).
This works for me at least.

@gkalpak
Copy link
Member

gkalpak commented Mar 10, 2016

BTW, you can download the latest ChromeDriver here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants