react-boilerplate: npm run setup fails

npm run setup fails after cloning the repo

OS: Ubuntu 14.04 node: 4.4.7 npm: 2.15.8

The following error is thrown Cannot find module 'lodash/defaultsDeep'

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 23 (13 by maintainers)

Most upvoted comments

Here’s my solution overall: With the fear of having a mess with my npm and node versions (cuz I’m using nvm and i didn’t want to get some version conflicts), what I did at the end was

npm install npm # This will install the latest version of npm only in the folder
npm cache clean
npm install
npm rb

Everything just started working πŸ˜ƒ @tomers @VladislavSournine

Installation failed for me on node v5.12.0 (npm v3.8.6). (before I opened package.json I had two tries with 4.6) No problems with latest version (6.9.1 - with and without Yarn). Since I didn’t use Yarn before (I wish I new about it during my last project!) it took be around 30mins to check all scenarios.

Information about supported node version in quick start section of readme would definitely improve first impression (also would prevent people forced to use certain version of node from trying and raising issues). After all it is a quick start πŸ˜ƒ

P.S. great work, thanks!

I happened to have npm<3 and I just checked out latest revision (Ubuntu 16.04 x64). I did not get a proper error message ([ERROR: React Boilerplate] You need npm version @>=3), as suggested by https://github.com/mxstbr/react-boilerplate/blob/3816242347c732b81686961d4faf6f7776ae309a/internals/scripts/npmcheckversion.js#L6. Instead, I got the following cryptic error message:

$ git clone --depth=1 https://github.com/mxstbr/react-boilerplate.git && cd react-boilerplate/        Cloning into 'react-boilerplate'...
remote: Counting objects: 286, done.
remote: Compressing objects: 100% (247/247), done.
remote: Total 286 (delta 28), reused 183 (delta 13), pack-reused 0
Receiving objects: 100% (286/286), 1.72 MiB | 1.19 MiB/s, done.
Resolving deltas: 100% (28/28), done.
Checking connectivity... done.
tomer@Kubuntu:~/dev/react-boilerplate$ npm run setup

> react-boilerplate@3.2.1 presetup /home/tomer/dev/react-boilerplate
> npm i chalk shelljs

chalk@1.1.3 node_modules/chalk
β”œβ”€β”€ escape-string-regexp@1.0.5
β”œβ”€β”€ supports-color@2.0.0
β”œβ”€β”€ ansi-styles@2.2.1
β”œβ”€β”€ has-ansi@2.0.0 (ansi-regex@2.0.0)
└── strip-ansi@3.0.1 (ansi-regex@2.0.0)

shelljs@0.7.4 node_modules/shelljs
β”œβ”€β”€ interpret@1.0.1
β”œβ”€β”€ rechoir@0.6.2 (resolve@1.1.7)
└── glob@7.1.1 (path-is-absolute@1.0.1, inherits@2.0.3, fs.realpath@1.0.0, once@1.4.0, inflight@1.0.5, minimatch@3.0.3)

> react-boilerplate@3.2.1 setup /home/tomer/dev/react-boilerplate
> node ./internals/scripts/setup.js


Cleaning old repository βœ“
Installing dependencies. βœ“ (This might take a while)Installing dependencies
Initialising new repository βœ“
Done!
> react-boilerplate@3.2.1 postsetup /home/tomer/dev/react-boilerplate
> npm run build:dll


> react-boilerplate@3.2.1 build:dll /home/tomer/dev/react-boilerplate
> node ./internals/scripts/dependencies.js

module.js:327
    throw err;
    ^

Error: Cannot find module 'lodash/defaultsDeep'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/tomer/dev/react-boilerplate/internals/scripts/dependencies.js:15:18)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)

npm ERR! Linux 4.4.0-38-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "build:dll"
npm ERR! node v4.6.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! react-boilerplate@3.2.1 build:dll: `node ./internals/scripts/dependencies.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the react-boilerplate@3.2.1 build:dll script 'node ./internals/scripts/dependencies.js'.
npm ERR! This is most likely a problem with the react-boilerplate package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./internals/scripts/dependencies.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs react-boilerplate
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls react-boilerplate
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/tomer/dev/react-boilerplate/npm-debug.log

npm ERR! Linux 4.4.0-38-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "setup"
npm ERR! node v4.6.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! react-boilerplate@3.2.1 postsetup: `npm run build:dll`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the react-boilerplate@3.2.1 postsetup script 'npm run build:dll'.
npm ERR! This is most likely a problem with the react-boilerplate package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build:dll
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs react-boilerplate
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls react-boilerplate
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/tomer/dev/react-boilerplate/npm-debug.log

Yes, package.json should mention node as well.

But IMHO, the code should serve as documentation as much as possible, because DRY. A middle ground could be to reference that package.json section from the README (so that the version is only written once and therefore doc won’t become incoherent later on when package.json changes).