preact-cli: Error: Cannot find module 'extract-text-webpack-plugin' with npm@5.2.0
$ preact -v
1.3.0
$ npm -v
5.2.0
Error:
Error: Cannot find module 'extract-text-webpack-plugin'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/khoa/web/mui/node_modules/preact-cli/lib/lib/webpack/webpack-base-config.js:13:33)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/khoa/web/mui/node_modules/preact-cli/lib/lib/webpack/webpack-client-config.js:39:26)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/khoa/web/mui/node_modules/preact-cli/lib/lib/webpack/run-webpack.js:27:28)
at Module._compile (module.js:569:30)
Reproduce:
- Init new project
preact create test && cd $_
npm start
P/s:
This only happens with npm@5.2.0. For some reason, node can’t resolve it
❯ npm ls extract-text-webpack-plugin
mui@1.0.0 /home/khoa/web/mui
└─┬ preact-cli@1.3.0
└─┬ @webpack-blocks/extract-text2@0.4.0
└── extract-text-webpack-plugin@2.1.2
My rule of thumb is if you use it, you must install it first. Thoughts @developit @lukeed ?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 2
- Comments: 22 (11 by maintainers)
Commits related to this issue
- Add missing dependencies (#306) - Extract-text-webpack-plugin - Chalk Closes #214 — committed to preactjs/preact-cli by anantoghosh 7 years ago
Got this error using the latest NPM, was able to “fix” by simply using yarn instead.
For anyone stuck:
yarn global add preact-cli
Then
yarn
andyarn start
in the created project.@anantoghosh webpack3 will be available in the next version (which might take sometime) because there are a bunch of things which we are planning for the next release