Skip to content

npm install fails on windows 10  #4956

Open

Description

@zhenzhuo

following the steps from https://github.com/codecombat/codecombat/wiki/Dev-Setup:-Windows
check: npm install --global --production windows-build-tools
fail: npm install

failure log:

c:\git_downloads\codecombat\node_modules\contextify\src\contextify.cc(150): error C2039: “SetAccessCheckCallbacks”: is not “v8::ObjectTemplat
e” the member of [C:\git_downloads\codecombat\node_modules\contextify\build\contextify.vcxproj]
......
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1

What looks strange is in the node_modules directory, there is no directory named "contextify"

 MINGW64 /c/git_downloads/codecombat (master)
$ ls node_modules/contextify
ls: cannot access 'node_modules/contextify': No such file or directory

Activity

  1. zhenzhuo commented on Oct 13, 2018

    @zhenzhuo
    Author

    I have tried according to #4655 by setting python 2.7 as below in powershell
    npm config set python C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Python 2.7
    still got the same results.
    Could anyone tell me if the Linux installation works?
    Thank you.

  2. changed the title [-]npm install fails on windows 10 , is it supposed to be?[/-] [+]npm install fails on windows 10 [/+] on Oct 13, 2018
  3. AndrewJakubowicz commented on Oct 16, 2018

    @AndrewJakubowicz
    Contributor

    Hi @zhenzhuo.

    Sorry you've had a problem installing on windows 10.

    node-sass is the library that pulls in the contextify and node-gyp. Unfortunately it requires some prerequisites for windows to work.

    Have you tried following option 2 of the node-gyp installation instructions?

  4. zhenzhuo commented on Oct 18, 2018

    @zhenzhuo
    Author

    @AndrewJakubowicz
    Thanks for replying.
    I tried to install node-gpy with
    npm install -g node-gyp
    no error reported but the node-gyp is not working.

    codecombat> node-gyp
    
    C:\git_downloads\codecombat>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js"  )  else (node ""  )
    module.js:550
        throw err;
        ^
    
    Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\node_modules\node_modules\node-gyp\bin\node-gyp.js'
    

    I also installed vs 2017 community and config npm
    npm config set msvs_version 2017
    still, install codecombat fails on node-gyp as below

    PS C:\git_downloads\codecombat> npm install
    > [email protected] install C:\git_downloads\codecombat\node_modules\contextify
    > node-gyp rebuild
    ......
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] install: `node-gyp rebuild`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] install script.
    
  5. AndrewJakubowicz commented on Nov 3, 2018

    @AndrewJakubowicz
    Contributor

    Regarding node-gyp not working. I can't help you very much there. You may need to ask on node-gyp. Once you are able to run node-gyp successfully it is still possible that the build will fail. In that case I recommend installing piecemeal:

    npm install node-sass
    npm install --ignore-scripts
    bower install
    npm install
    

    Also dig around in our issues wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions