Some notes while stepping through your link:
- At the end of step 5 it shows that I need to add app.UseKendo(env); to the Startup.Configure method. Is this needed? This method call is marked as depreciated.
- This document references NPM Client Install Copying Kendo UI Client Resources through NPM and Webpack
- Step 6 says I need to run command line: npm run build
- My package.json has the scripts section with "build" but the command line responds with the "npm ERR! missing script: build" error. Here is my package.json definition:
{
"version": "1.0.0",
"name": "asp.net",
"private": true,
"main": "main.js",
"scripts": {
"build": "webpack"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"css-loader": "^1.0.0",
"jquery": "^3.3.1",
"popper.js": "^1.14.5",
"style-loader": "^0.23.1",
"@progress/kendo-theme-default": "^2.54.1",
"@progress/kendo-ui": "2018.3.1114"
},
"devDependencies": {
"webpack": "^4.26.0",
"webpack-cli": "^3.1.2",
"bootstrap": "3.3.1",
"bootstrap-touch-carousel": "0.8.0",
"jquery": "3.3.1",
"jquery-validation": "1.18.0",
"jquery-validation-unobtrusive": "3.2.11"
}
}
Build points to webpack so this is what my webpack.config.js file looks like:
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './main.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'wwwroot')
},
module: {
rules: [
{
test: /\.css$/,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }]
}
]
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'
}),
],
}
Here is the log file:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using npm@6.4.1
3 info using node@v10.13.0
4 verbose stack Error: missing script: build
4 verbose stack at run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:155:19)
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:63:5
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:115:5
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:418:5
4 verbose stack at checkBinReferences_ (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:373:45)
4 verbose stack at final (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:416:3)
4 verbose stack at then (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:160:5)
4 verbose stack at ReadFileContext.<
anonymous
> (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:332:20)
4 verbose stack at ReadFileContext.callback (C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16)
4 verbose stack at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:235:13)
5 verbose cwd C:\GSI\Gsi.Amtas.Cloud\GsiAmtasPortal
6 verbose Windows_NT 10.0.14393
7 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
8 verbose node v10.13.0
9 verbose npm v6.4.1
10 error missing script: build
11 verbose exit [ 1, true ]