学习webpack时使用npm run 命令出错,直接webpack就可以打包? 400 报错
{ "name": "webpack_test02", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo "Error : no test specified"&& exit 1", "webpack": "webpack " },
配置里就是这么写的,在命令行直接使用webpack就可以顺利打包,使用npm run webpack提示错误,如下
Error: Cannot find module 'os-browserify/browser.script'
at Function.Module._resolveFilename (module.js:469:15)
at Function.resolve (internal/module.js:27:19)
at Object.<anonymous> (D:\app\webpack_test02\node_modules\node-libs-browser\index.js:17:28)
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)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (D:\app\webpack_test02\node_modules\webpack\lib\node\NodeSourcePlugin.js:7:23)
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)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at WebpackOptionsApply.process (D:\app\webpack_test02\node_modules\webpack\lib\WebpackOptionsApply.js:71:25)
at webpack (D:\app\webpack_test02\node_modules\webpack\lib\webpack.js:36:48)
at processOptions (D:\app\webpack_test02\node_modules\webpack\bin\webpack.js:305:14)
at Object.<anonymous> (D:\app\webpack_test02\node_modules\webpack\bin\webpack.js:363:1)
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)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\node.js\\node.exe" "C:\\node.js\\node_modules\\npm\\bin\\npm-cli.js" "run" "webpack"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! webpack_test02@1.0.0 webpack: `webpack `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webpack_test02@1.0.0 webpack 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_test02 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_test02
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls webpack_test02
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\app\webpack_test02\npm-debug.log
楼主找到解决的方法了吗 我也碰到了。求指教
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。