これまでnpm run <script name>コマンドのエラーが何度もあったのですが、今回また違う感じのエラーが出たので質問させて頂きます。
npm run webpack
と入力すると
html
1> vaio@1.0.0 webpack C:\Users\VAIO 2> webpack 'src/{**/,*/}*.ts' 3 4 5Insufficient number of arguments or no entry found. 6Alternatively, run 'webpack(-cli) --help' for usage info. 7 8Hash: d073a1f0213226452660 9Version: webpack 4.43.0 10Time: 91ms 11Built at: 2020-06-10 0:04:05 12 13ERROR in Entry module not found: Error: Can't resolve ''src/{**/,*/}*.ts'' in 'C:\Users\VAIO' 14npm ERR! code ELIFECYCLE 15npm ERR! errno 2 16npm ERR! vaio@1.0.0 webpack: `webpack 'src/{**/,*/}*.ts'` 17npm ERR! Exit status 2 18npm ERR! 19npm ERR! Failed at the vaio@1.0.0 webpack script. 20npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 21 22npm ERR! A complete log of this run can be found in: 23npm ERR! C:\Users\VAIO\AppData\Roaming\npm-cache\_logs\2020-06-09T15_04_05_612Z-debug.log
とエラーが出る。
指南本に従ってpackage.jsonのscriptsディレクティブにwebpackコマンドを追加したはずなのですが、エラーが出てしまいました
package.json
html
1{ 2 "name": "vaio", 3 "version": "1.0.0", 4 "description": "", 5 "main": "hello_world.js", 6 "scripts": { 7 "test": "echo \"Error: no test specified\" && exit 1", 8 "tsc": "tsc", 9 "tslint": "tslint 'src/{**/,*/}*.ts'", 10 "typedoc": "typedoc", 11 "webpack": "webpack'" 12 }, 13 "author": "", 14 "license": "ISC", 15 "dependencies": { 16 "give-me-a-joke": "^0.3.2", 17 "node-fetch": "^2.6.0", 18 "vue": "^2.6.10", 19 "vue-loader": "^15.9.2" 20 }, 21 "devDependencies": { 22 "ts-loader": "^7.0.5", 23 "tslint": "^6.1.2", 24 "tslint-config-airbnb": "^5.11.2", 25 "typedoc": "^0.17.6", 26 "typescript": "^3.8.3", 27 "webpack": "^4.43.0", 28 "webpack-cli": "^3.3.11", 29 "webpack-dev-server": "^3.11.0" 30 } 31} 32
webpack.config.json
html
1const path = require('path'); 2 3module.exports = (env, argv) => { 4return { 5mode: 'production', 6entry: { 7index: path.join(__dirname, 'index.ts'), 8}, 9 10output: { 11path: path.join(__dirname, 'www'), 12filename: 'test_npm.js', 13library: 'test_npm', 14libraryTarget: 'umd' 15}, 16 17module: { 18rules: [ 19{ 20test: /.ts$/, 21use: [{ loader: 'ts-loader' }] 22} 23] 24} 25} 26};
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/06/08 13:27 編集
2020/06/08 13:55
2020/06/08 21:21
2020/06/09 12:32
2020/06/09 15:08
2020/06/10 11:17
2020/06/10 20:20