Error: Cannot find module '../package.json'
See original GitHub issuewebpack
module.js:471 throw err; ^
Error: Cannot find module ‘…/package.json’ at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> (/Users/vinyuan/code/uculture/webpack-demo3/node_modules/.bin/webpack:17:22) at Module._compile (module.js:570:32) at Object.Module._extensions…js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3)
npm ERR! Darwin 16.5.0
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “run” “build”
npm ERR! node v6.11.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! webpack-demo2@1.0.0 build: webpack
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webpack-demo2@1.0.0 build script ‘webpack’.
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 webpack-demo2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs webpack-demo2
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls webpack-demo2
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! /Users/vinyuan/code/uculture/webpack-demo3/npm-debug.log
Do you want to request a feature or report a bug?
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
If this is a feature request, what is motivation or use case for changing the behavior?
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9
@mygovernance I had the same error after moving a project to a different directory. I fixed it by nuking my node_modules and redoing ‘npm install’.