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

reactBoilerplateDeps: Module not found errors on Windows 7 #769

Closed
edoloughlin opened this issue Jul 22, 2016 · 16 comments
Closed

reactBoilerplateDeps: Module not found errors on Windows 7 #769

edoloughlin opened this issue Jul 22, 2016 · 16 comments

Comments

@edoloughlin
Copy link

edoloughlin commented Jul 22, 2016

Description

Webback can't resolve modules when building reactBoilerplateDeps

Steps to reproduce

running npm run setup goes ok until it tries to run internals/dependencies.js:

> node ./internals/scripts/dependencies.js

Building the Webpack DLL...
Hash: c2d0bb44497ebed0b2ce
Version: webpack 1.12.14
Time: 82ms
                      Asset     Size  Chunks             Chunk Names
reactBoilerplateDeps.dll.js  1.65 kB       0  [emitted]  reactBoilerplateDeps
chunk    {0} reactBoilerplateDeps.dll.js (reactBoilerplateDeps) 12 bytes [rendered]
    [0] dll reactBoilerplateDeps 12 bytes {0} [built] [19 errors]

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'babel-polyfill' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'fontfaceobserver' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'react-router-scroll' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'redux' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'redux-immutable' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'redux-saga' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'reselect' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'whatwg-fetch' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'core-js' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'lodash' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'eventsource-polyfill' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'history' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'immutable' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'react' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'react-dom' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'react-helmet' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'react-redux' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'react-router' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps

ERROR in dll reactBoilerplateDeps
Module not found: Error: Cannot resolve module 'react-router-redux' in C:\Users\a\git\react-boilerplate-test2
 @ dll reactBoilerplateDeps
npm info lifecycle react-boilerplate@3.0.0~postbuild:dll: react-boilerplate@3.0.0
npm info ok
npm info ok

Versions

  • Node: 6.3.1
  • NPM: 3.10.5
  • OS: Windows 7
  • Browser: N/A
@gihrig
Copy link
Contributor

gihrig commented Jul 22, 2016

Try npm cache clean then start over with a new clone of react-boilerplate.

@edoloughlin
Copy link
Author

I get the same error.

@edoloughlin
Copy link
Author

edoloughlin commented Jul 25, 2016

Got it working. I had to:

  • remove ngrok from package.json (does not install properly on Windows)
  • run:
npm cache clean
npm install
npm install eslint -g
npm run setup

The 'Installing dependencies...' part of the setup seems to do nothing on Windows. The node_modules directory is empty after this completes.

@gihrig
Copy link
Contributor

gihrig commented Jul 25, 2016

I'm curious to see what happens if you:

  • Clone a new copy of react boilerplate
  • Edit package.json to remove scripts preinstall and postinstall
  • run npm install You should end up with something like 1154 items in node_modules

If you do not get the expected node_modules, please post your npm-debug.log

If you do get the expected node modules, run
npm run build:dll

Then
npm start

Let us know what happens.

@cenmeejs
Copy link

cenmeejs commented Jul 26, 2016

I use webpack to compress images,then get this error

    ERROR in ./test.gif
    Module build failed: Error: ϵͳ�Ҳ���ָ����·����

        at notFoundError (D:\mjx_project\proj_mjx_web_v1.0\B2CUI\node_modules\cross-spawn\lib\enoent.js:11:11)
        at verifyENOENT (D:\mjx_project\proj_mjx_web_v1.0\B2CUI\node_modules\cross-spawn\lib\enoent.js:46:16)
        at ChildProcess.cp.emit (D:\mjx_project\proj_mjx_web_v1.0\B2CUI\node_modules\cross-spawn\lib\enoent.js:33:19)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
     @ ./app.js 1:0-21

    ERROR in ./test.png
    Module build failed: Error: ϵͳ�Ҳ���ָ����·����

        at notFoundError (D:\mjx_project\proj_mjx_web_v1.0\B2CUI\node_modules\image-webpack-loader\node_modules\imagemin-optipng\node_modules\exec-buffer\node_modules\execa\node_modules\cross-spawn-async\lib\enoent.js:8:11)
        at verifyENOENT (D:\mjx_project\proj_mjx_web_v1.0\B2CUI\node_modules\image-webpack-loader\node_modules\imagemin-optipng\node_modules\exec-buffer\node_modules\execa\node_modules\cross-spawn-async\lib\enoent.js:43:16)
        at ChildProcess.cp.emit (D:\mjx_project\proj_mjx_web_v1.0\B2CUI\node_modules\image-webpack-loader\node_modules\imagemin-optipng\node_modules\exec-buffer\node_modules\execa\node_modules\cross-spawn-async\lib\enoent.js:30:19)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
     @ ./app.js 3:0-21

    ERROR in ./test.jpg
    Module build failed: Error: ϵͳ�Ҳ���ָ����·����

        at notFoundError (D:\mjx_project\proj_mjx_web_v1.0\B2CUI\node_modules\image-webpack-loader\node_modules\imagemin-jpegtran\node_modules\exec-buffer\node_modules\execa\node_modules\cross-spawn-async\lib\enoent.js:8:11)
        at verifyENOENT (D:\mjx_project\proj_mjx_web_v1.0\B2CUI\node_modules\image-webpack-loader\node_modules\imagemin-jpegtran\node_modules\exec-buffer\node_modules\execa\node_modules\cross-spawn-async\lib\enoent.js:43:16)
        at ChildProcess.cp.emit (D:\mjx_project\proj_mjx_web_v1.0\B2CUI\node_modules\image-webpack-loader\node_modules\imagemin-jpegtran\node_modules\exec-buffer\node_modules\execa\node_modules\cross-spawn-async\lib\enoent.js:30:19)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
     @ ./app.js 2:0-21

@cenmeejs
Copy link

I get the same error,too

@cenmeejs
Copy link

when I use gulp minify images. get this error,too(I use Window 7)

λ gulp
[10:16:17] Using gulpfile D:\mjx_project\proj_mjx_web_v1.0\B2CUI\gulpfile.js
[10:16:17] Starting 'default'...

events.js:160
      throw er; // Unhandled 'error' event
      ^
 Error: ϵͳ�Ҳ���ָ����·����

    at notFoundError (D:\mjx_project\proj_mjx_web_v1.0\B2CUI\node_modules\cross-spawn-async\lib\enoent.js:8:11)
    at verifyENOENT (D:\mjx_project\proj_mjx_web_v1.0\B2CUI\node_modules\cross-spawn-async\lib\enoent.js:43:16)
    at ChildProcess.cp.emit (D:\mjx_project\proj_mjx_web_v1.0\B2CUI\node_modules\cross-spawn-async\lib\enoent.js:30:19)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)

@gihrig
Copy link
Contributor

gihrig commented Jul 26, 2016

Are you by any chance using cnpm? Try main npm see #467 (comment).

@cenmeejs
Copy link

Thank a lot .My problem has been resolved.I remove all node_modules that install from cnpm .then use npm install again ,then the errors disappear

@edoloughlin
Copy link
Author

edoloughlin commented Jul 27, 2016

@gihrig npm install populates node_modules ok, but with the following warnings:

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
npm WARN eslint-config-airbnb@9.0.1 requires a peer of eslint@^2.9.0 but none was installed.
npm WARN eslint-config-airbnb@9.0.1 requires a peer of eslint-plugin-jsx-a11y@^1.2.0 but none was installed.
npm WARN eslint-config-airbnb-base@3.0.1 requires a peer of eslint@^2.9.0 but none was installed.
npm WARN extract-text-webpack-plugin@1.0.1 requires a peer of webpack@^1.9.11 but none was installed.
npm WARN karma-webpack@1.7.0 requires a peer of webpack@^1.4.0 but none was installed.
npm WARN scroll-behavior@0.7.0 requires a peer of history@^1.12.1 || ^2.0.0 but none was installed.

I have:

  • eslint 3.1.1
  • eslint-plugin-jsx-a11y 2.0.1
  • webpack 2.1.0-beta.15
  • history 3.0.0

npm run build:dll completes without errors. When I run npm start and then try to access localhost:3000 I get the same problem I reported in #781:

git/react-boilerplate-tester ‹master› » npm start
npm info it worked if it ends with ok
npm info using npm@3.10.3
npm info using node@v6.3.1
npm info ok
npm info it worked if it ends with ok
npm info using npm@3.10.5
npm info using node@v6.3.1
npm info lifecycle react-boilerplate@3.0.0~prestart: react-boilerplate@3.0.0
npm info lifecycle react-boilerplate@3.0.0~start: react-boilerplate@3.0.0

> react-boilerplate@3.0.0 start C:\users\a\git\react-boilerplate-tester
> cross-env NODE_ENV=development node server

Server started ✓

Access URLs:
-----------------------------------
Localhost: http://localhost:3000
      LAN: http://[redacted]:3000
-----------------------------------
Press CTRL-C to stop

webpack built 05cff1c4a2e85635aa72 in 18582ms

ERROR in ./app/containers/App/banner-metal.jpg
Module build failed: Error: The system cannot find the path specified.

    at notFoundError (C:\Users\a\git\react-boilerplate-tester\node_modules\cross-spawn-async\lib\enoent.js:8:11)
    at verifyENOENT (C:\Users\a\git\react-boilerplate-tester\node_modules\cross-spawn-async\lib\enoent.js:43:16)
    at ChildProcess.cp.emit (C:\Users\a\git\react-boilerplate-tester\node_modules\cross-spawn-async\lib\enoent.js:30:19)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
 @ ./app/containers/App/index.js 17:0-40
Child html-webpack-plugin for "index.html":

@gihrig
Copy link
Contributor

gihrig commented Jul 27, 2016

The warnings are generally not significant.
As for Windows 10, it has recently been confirmed to build correctly.

./app/containers/App/index.js line 17 is attempting to import banner-metal.jpg from the same folder, does that file exist?

I'm just guessing here, but if the file exists try these steps and see what happens.

@edoloughlin
Copy link
Author

edoloughlin commented Jul 27, 2016

The file exists. Your suggestion for removing image-webpack worked. Looks like there's a regression in npm 3 on windows 7: tcoopman/image-webpack-loader#16

Thanks!

@gihrig
Copy link
Contributor

gihrig commented Jul 27, 2016

That was a tough one, well done on finding it!

npm 3.10.6 might have a relevant fix.

Note that react-boilerplate has a requirement for npm 3+

@sourcesoft
Copy link

I'm just guessing here, but if the file exists try these steps and see what happens

Mine worked after removing image optimization.

@ubergarm
Copy link

ubergarm commented Sep 8, 2016

I just had the same problem with the ERROR in ./app/containers/App/banner-metal.jpg business in Linux under Docker.

You can quickly repeat and fix this error using the following steps.

Freshly clone the repo and get inside a Docker container:

git clone --depth=1 https://github.com/mxstbr/react-boilerplate.git
cd react-boilerplate
docker run -v `pwd`:/app -p 3000:3000 --rm -it --entrypoint=/bin/sh mhart/alpine-node

Inside the Docker container:

node --version #v6.4.0
npm --version #3.10.6
cd /app
npm run setup
npm start

The fix for me was the same as what @sourcesoft and @gihrig recommended: removing optimizations then running npm start again.

Edit react-boilerplate/internals/webpack/webpack.base.babel.js and remove one line:

Original:

    test: /\.(jpg|png|gif)$/,
      loaders: [
        'file-loader',
        'image-webpack?{progressive:true, optimizationLevel: 7, interlaced: false, pngquant:{quality: "65-90", speed: 4}}',
      ],

Fixed:

    test: /\.(jpg|png|gif)$/,
      loaders: [
        'file-loader',
      ],

@lock
Copy link

lock bot commented May 30, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 30, 2018
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

6 participants