A
A
Alex Polyakh2017-08-02 12:09:12
JavaScript
Alex Polyakh, 2017-08-02 12:09:12

Build error create react app(webpack) (Cannot find module 'escope') how to fix?

I installed a ready-made template https://github.com/facebookincubator/create-react-app from the official site ,
added my own dependencies. During the first installation, when we write npm i at the root of the project, then we start the build via npm start https://prnt.sc/g3c5bj (error screenshot), if we run npm i a second time, everything works.
Below is the full error code.
I will attach what I have in package.json:
link to the file in codepen https://codepen.io/PolyakhAlex/pen/eEzxMM?editors=1010
{
"name": "template",
"version": "0.1.0" ,
"private": true,
"dependencies": {
"classnames": "^2.2.5",
"is_js": "^0.8.0",
"isomorphic-fetch": "^2.2.1",
"lodash": "^4.15.0",
"node-sass-chokidar": "0.0.3",
" npm-run-all": "^4.0.2",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-redux": "^5.0.5" ,
"react-router": "3.0.2",
"react-router-redux": "^4.0.8",
"react-scripts": "1.0.10",
"redux": "^3.6.0" ,
"redux-devtools-extension": "^2.13.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0"
},
"scripts": {
"build-css": "node-sass-chokidar src/ -o src/",
"watch-css": "npm run build- css && node-sass-chokidar src/ -o src/ --watch --recursive",
"start-js": "react-scripts start",
"start": "npm-run-all -p watch-css start-js",
"build": "npm run build-css && react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"lint": "eslint ./src"
},
"devDependencies": {
"autoprefixer-loader": "^3.2.0",
"babel-core": "^6.13.2",
"babel-eslint": "^6.1.2",
"babel-loader": "^6.2.4",
"babel-plugin -transform-runtime": "^6.12.0",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.13.2",
"babel-preset-react": "^6.11.1",
"babel-preset-stage- 0": "^6.5.0",
"css-loader": "^0.23.1",
"eslint": "^4.3.0",
"eslint-plugin-react": "^6.10.3",
"extract-text-webpack-plugin": " ^1.0.1",
"file-loader": "^0.9.0",
"url-loader": "^0.5.7",
"react-i18next": "^4.7.0",
"i18next": " ^7.1.1"
}
}
error
========================================= =
Error: Cannot find module 'escope'
at Function.Module._resolveFilename (module.js:469:15)
at monkeypatch (C:\Projects\login_static\node_modules\babel-eslint\index.js:41:26)
at Object .exports.parse (C:\Projects\login_static\node_modules\babel-eslint\index.js:384:5)
at parse (C:\Projects\login_static\node_modules\eslint\lib\linter.js:673:23)
at Linter.verify (C:\Projects\login_static\node_modules\eslint\lib\linter.js:808:27)
at processText (C:\Projects\login_static\node_modules\eslint\lib\cli-engine.js:203:31)
at CLIEngine.executeOnText (C:\Projects\login_static\node_modules\eslint\lib\cli-engine.js: 668:26)
at lint (C:\Projects\login_static\node_modules\eslint-loader\index.js:211:17)
at Object.module.exports (C:\Projects\login_static\node_modules\eslint-loader\index. js:206:21)
at LOADER_EXECUTION (C:\Projects\login_static\node_modules\loader-runner\lib\LoaderRunner.js:119:14)
at runSyncOrAsync (C:\Projects\login_static\node_modules\loader-runner\lib\ LoaderRunner.js:120:4)
at iterateNormalLoaders (C:\Projects\login_static\node_modules\loader-runner\lib\LoaderRunner.js:229:2)
at Array. (C:\Projects\login_static\node_modules\loader-runner\lib\LoaderRunner.js:202:4)
at Storage.finished (C:\Projects\login_static\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:40: 15)
at C:\Projects\login_static\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:77:9
at C:\Projects\login_static\node_modules\graceful-fs\graceful-fs.js:78:16
npm ERR ! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start- js"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR!
npm ERR! [email protected] start-js: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start-js script 'react-scripts start'.
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 template package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! react-scripts start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs template
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls template
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Projects\login_static\npm-debug.log
ERROR: "start-js" exited with 1.
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `npm-run-all -p watch-css start-js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'npm-run-all -p watch-css start-js'.
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 template package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm-run-all -p watch-css start-js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs template
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls template
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Projects\login_static\npm-debug.log

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2017-08-02
@PolyakhAleksandr

Upgrade to version 7 of babel because you have eslint 4.3.0 and it needs eslint-scope.
Also suggest updating nodejs to 8 and npm to 5.3.0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question