Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install dependencies with npm >= 3.9 #7874

Closed
csvn opened this issue Jun 19, 2016 · 19 comments
Closed

Can't install dependencies with npm >= 3.9 #7874

csvn opened this issue Jun 19, 2016 · 19 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded
Milestone

Comments

@csvn
Copy link
Contributor

csvn commented Jun 19, 2016

I was thinking of making a pull request, and tried checking out and building the vscode source, but I get the error MSVSProject' object has no attribute 'iteritems' when I try to run scripts\npm install.

image

I followed the instructions How to run from Source, and tried out the instructions Compiling native addon modules when that didn't work. I can get e.g. bson and node-sass to install and compile native code via node-gyp without issues.

image

I can't seem to figure out what's causing this issue. Any help is greatly appreciated.

System info:
Windows 10
npm@3.9.6
node@6.2.2
git 2.9.0.windows.1

@dbaeumer dbaeumer added the bug Issue identified by VS Code Team member as probable bug label Jun 20, 2016
@joaomoreno
Copy link
Member

The error occurs in fsevents, which is an optional dependency. It is expected to fail in Windows, you can continue as if the error didn't occur.

@csvn
Copy link
Contributor Author

csvn commented Jun 21, 2016

Yes, fsevents is optional and should fail, but npm should not exit with error code 1 because of it, preventing further installs or postinstall hook from running.

I figured out the cause of this though, I tried this on another machine where install worked. When I updated npm it stopped working. The latest working npm version seems to be 3.8.9. npm@^3.9.0 seems to cause the install to fail with exit code 1.

But feel free to verify that this is not only an issue on my end.

I haven't figured out what npm change causes this, but it might be good to have a heads up in the "Development workflow" section, until this is sorted out.

@lurdan
Copy link

lurdan commented Jun 21, 2016

as csvn says, fresh clone & build fails because of this.

@joaomoreno
Copy link
Member

joaomoreno commented Jun 22, 2016

Oh. It had always returned error code 0 with those errors...

3.9.0 might've changed it, it's worthwhile to look into.

@joaomoreno
Copy link
Member

npm/npm#12698

@joaomoreno joaomoreno changed the title gyp error during source install Can't install dependencies with npm >= 3.9 Jul 12, 2016
@joaomoreno joaomoreno added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Jul 13, 2016
@joaomoreno joaomoreno modified the milestones: Backlog, July 2016 Jul 13, 2016
@joaomoreno
Copy link
Member

Meanwhile: use npm < 3.9.

@ramya-rao-a
Copy link
Contributor

I have a Windows 10 machine with VS 2015. If I use npm < 3.9, node-gyp fails while installing onigurama module.
What I ended up doing was to remove fsevents from npm-shrinwrap.json and get the latest npm. Install then runs without any errors. Even then I had to install native-keymap manually.

@joaomoreno
Copy link
Member

@ramya-rao-a did you get any insights from @Tyriar? Can you still send me the (non verbose) npm install log?

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Jul 18, 2016

@joaomoreno Below is the part of the npm install log that fails while installing onigurama module.
Using latest npm solves this for me. This might be specific to VS 2015.

TLDR; win_delay_load_hook.c(34): error C2373: '__pfnDliNotifyHook2': redefinition; different type modifiers [C:\...\vscode\node_modules\oniguruma\build\oniguruma.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h(134): note: see declaration of '__pfnDliNotifyHook2'

Longer version:

> oniguruma@6.0.1 install C:\...\vscode\node_modules\oniguruma
> node-gyp rebuild


C:\...\vscode\node_modules\oniguruma>if not defined npm_config_node_gyp (node "C:\Users\ramyar\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.
  regcomp.c
  regenc.c
  regerror.c
  regexec.c
  regext.c
  reggnu.c
  regparse.c
  regposerr.c
  regposix.c
  regsyntax.c
  regtrav.c
  regversion.c
  st.c
  ascii.c
  big5.c
  cp1251.c
  euc_jp.c
  euc_kr.c
  euc_tw.c
  gb18030.c
  iso8859_1.c
  iso8859_2.c
  iso8859_3.c
  iso8859_4.c
  iso8859_5.c
  iso8859_6.c
  iso8859_7.c
  iso8859_8.c
  iso8859_9.c
  iso8859_10.c
  iso8859_11.c
  iso8859_13.c
  iso8859_14.c
  iso8859_15.c
  iso8859_16.c
  koi8.c
  koi8_r.c
  mktable.c
  sjis.c
  unicode.c
  utf16_be.c
  utf16_le.c
  utf32_be.c
  utf32_le.c
  utf8.c
  win_delay_load_hook.c
C:\Users\ramyar\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error C2373: '__pfnDliNotifyHook2': redefinition; different type modifiers [C:\...\vscode\node_modules\oniguruma\build\oniguruma.vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h(134): note: see declaration of '__pfnDliNotifyHook2'
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\ramyar\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ramyar\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\...\vscode\node_modules\oniguruma
gyp ERR! node -v v6.3.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@0.3.8
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ramyar\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.3.0
npm ERR! npm  v3.8.9
npm ERR! code ELIFECYCLE

npm ERR! oniguruma@6.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the oniguruma@6.0.1 install script 'node-gyp rebuild'.
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 oniguruma package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs oniguruma
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls oniguruma
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\...\vscode\npm-debug.log

@Tyriar
Copy link
Member

Tyriar commented Jul 19, 2016

@joaomoreno installed VS 2015 with Windows 10 SDK and C++ tools, installed Python 2.7, added it to PATH and had a PYTHON environment variable set too. Nothing was obvious to me, I've only successfully set up vscode dev on Windows once though.

@joaomoreno
Copy link
Member

nodejs/node-gyp#972

@Tyriar
Copy link
Member

Tyriar commented Sep 5, 2016

@ramya-rao-a did you end up getting around this issue? I'm running into it on my Windows 10 laptop and npm@next is not as option since it's v3.10.

@ramya-rao-a
Copy link
Contributor

@Tyriar Did you remove fsevents from npm-shrinwrap.json ?

@Tyriar
Copy link
Member

Tyriar commented Sep 7, 2016

@ramya-rao-a nope. If that is the fix, any idea why this happens on some Windows 10 machines and not others?

@ramya-rao-a
Copy link
Contributor

@Tyriar What are your errors around? The onigurama or fsevents?

@Tyriar
Copy link
Member

Tyriar commented Sep 8, 2016

@ramya-rao-a __pfnDliNotifyHook2 error on oniguruma

@JustinPealing
Copy link

I've been having this issue but fixed it by using npm 2

npm install npm@2 -g

@Tyriar
Copy link
Member

Tyriar commented Sep 9, 2016

@JustinPealing you may run into other issues with npm 2. They may only be during the packaging steps though so development might be fine.

@Tyriar
Copy link
Member

Tyriar commented Sep 12, 2016

Instructions to fix this were added to https://github.com/Microsoft/vscode/wiki/How-to-Contribute#installing-prerequisites by @bpasero, closing this off. The fix to all these related issues seems to be to update node and use the nearly released npm 3.10.8 which has the fix for optional dependencies.

@Tyriar Tyriar closed this as completed Sep 12, 2016
@ramya-rao-a ramya-rao-a added the verified Verification succeeded label Sep 28, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants