Skip to content

dev setup npm install errors #4652

Open

Description

@Wesley-Li

Hi guys,
I am trying to setup dev server according to this link:
https://github.com/codecombat/codecombat/wiki/Dev-Setup:-Linux

Unfortunately, I got many errors for npm install, snippet like this:
bower underscore.string#~2.3.3 EINVRES Request to https://registry.bower.io/packages/underscore.string failed with 403
✖ Install fail! Error: post install error, please remove node_modules before retry!
Run "sh -c bower install && webpack" error, exit code 1
Error: post install error, please remove node_modules before retry!
Run "sh -c bower install && webpack" error, exit code 1
at ChildProcess. (/usr/local/lib/node_modules/cnpm/node_modules/runscript/index.js:65:21)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

I tried to change the target version, but, even if this guy is successfully installed, there is always another error for bower.

Anyone hit this?
My env:
Python 2.7.10; Ubuntu 15.10; node(currently use 4.4.0, but I also tried v5, v6, v8 with all failed)

Activity

  1. nwinter commented on Mar 28, 2018

    @nwinter
    Contributor

    Should be on node 6 now, and make sure to nuke node_modules before reinstalling if you can fix the bower thing.

    Have you searched for that particular bower error? From my first look, it seems like bower might be blocked or something within your particular network environment? Could be wrong there.

  2. Wesley-Li commented on Mar 29, 2018

    @Wesley-Li
    Author

    The network environment should be OK.
    In case of the network issue, I changed to another VPS(node v6.0.0) located at Japan.
    For npm install , get error here:
    npm WARN deprecated [email protected]: This project is unmaintained
    extract:yamljs → gunzTarP ▌ ╢███████████████████████████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
    Killed
    [root@yj codecombat]#

  3. andreihava-okta commented on Mar 29, 2018

    @andreihava-okta

    @nwinter I'm facing a similar issue on a Windows Server 2016 instance, fresh installation, Node 8.

    UPDATE: Rolling back to Node 6 has the same result.

    $ npm install
    
    > [email protected] preinstall C:\Users\Administrator\Documents\CodeCombat\codecombat\node_modules\esper.js
    > node contrib/install-plugin-deps.js
    
    events.js:183
          throw er; // Unhandled 'error' event
          ^
    
    Error: spawn npm ENOENT
        at _errnoException (util.js:1022:11)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
        at onErrorNT (internal/child_process.js:372:16)
        at _combinedTickCallback (internal/process/next_tick.js:138:11)
        at process._tickCallback (internal/process/next_tick.js:180:9)
        at Function.Module.runMain (module.js:695:11)
        at startup (bootstrap_node.js:188:16)
        at bootstrap_node.js:609:3
    npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN The package intercom-client is included as both a dev and production dependency.
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
    
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] preinstall: `node contrib/install-plugin-deps.js`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] preinstall script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
  4. Wesley-Li commented on Mar 29, 2018

    @Wesley-Li
    Author

    Actually, I also get the error above upon another setup.
    I tried several VPS with Ubuntu or Centos having node v6.0.0 installed.
    All failed with different issues...

    Did you guys test the setup instructions?

  5. nwinter commented on Mar 29, 2018

    @nwinter
    Contributor

    @basicer does this esper.js pre-install issue seem familiar?

  6. Wesley-Li commented on Apr 2, 2018

    @Wesley-Li
    Author

    Is this dead thread? Anybody keep an eye on this?

  7. nwinter commented on Apr 4, 2018

    @nwinter
    Contributor

    Sorry @Wesley-Li, it's a little hard for us to keep up with requests to help debug various build issues, which often end up being in unrelated node modules. Straight-up npm install and bower install commands do work in our tests, and then it's a guessing game as to which dependency is not working on which platform with which configuration.

    For your particular issue, sounds like bower is failing to get all dependencies but gets some of them each run; can you just bower install over and over until it succeeds in pulling them all down?

  8. Wesley-Li commented on Apr 10, 2018

    @Wesley-Li
    Author

    Finally after over and over again bower install, get the setup finished.
    However, when I run the dev server and browser 127.0.0.1:3000, I get a lot error messages like:
    Uncaught TypeError: _this.$el.find(...).nanoScroller is not a function

    I checked and see nanoscroller within both node_modules and bower_components.

    Anything wrong?

  9. nwinter commented on Apr 11, 2018

    @nwinter
    Contributor

    Hmm, that's odd. You ran npm run dev or npm run webpack in order to trigger the client-side build, right?

  10. Wesley-Li commented on Apr 12, 2018

    @Wesley-Li
    Author

    @nwinter Yes, I use npm run dev; anyway to fix this?

  11. nwinter commented on Apr 13, 2018

    @nwinter
    Contributor

    Try running npm run webpack by itself? Is the public folder correctly built? Is your codecombat/public/javascripts/vendor.js around 2.6MB? If not, something might not have been downloaded/built during the client-side build process; if so, then it must be something else. No error messages during the build?

  12. Wesley-Li commented on Apr 13, 2018

    @Wesley-Li
    Author

    wnicodecombat.log
    deepinscrot-2036

    Could you please have a look at the attached run dev log and web snippet?

  13. nwinter commented on Apr 23, 2018

    @nwinter
    Contributor

    Hmm, not sure why that's not working; build log looks like it built everything okay. vendor.js file around the right size, ~2.6MB?

  14. swhgoon commented on May 30, 2018

    @swhgoon

    @Wesley-Li maybe caused by cnpm, try npm instead

  15. mmnishid commented on Jun 12, 2018

    @mmnishid
    Contributor

    I get a similar issue running npm install on Windows 10

    C:\Users\MMN\Documents\GitHub\codecombat>npm install
    npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\MMN\Documents\GitHub\codecombat\node_modules\fsevents\node_modules'

    [email protected] postinstall C:\Users\MMN\Documents\GitHub\codecombat
    bower install && webpack

    module.js:549
    throw err;
    ^

    Error: Cannot find module 'internal/util/types'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at evalmachine.:31:26
    at Object. (C:\Users\MMN\Documents\GitHub\codecombat\node_modules\bower\node_modules\graceful-fs\fs.js:11:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] postinstall: bower install && webpack
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] postinstall script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\MMN\AppData\Roaming\npm-cache_logs\2018-06-12T20_54_47_608Z-debug.log

    Tracing this issue in the log files it seems like the issue is happening where npm install is trying to run 'bower install && webpack' and may have something to do with 'fsevents' which is a MacOS only dependency.

  16. nwinter commented on Jun 13, 2018

    @nwinter
    Contributor

    @mmnishid try a few different versions of npm to see what works? 6.1.0, 5.6.0, 5.0.4, 3.10.10 (npm install -g [email protected], delete node_modules, and then npm install again.)

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