I have an Angular-5 application with:
"@types/lodash-es": "^4.17.4",
Initially, When I did ng serve, I got this error:
ERROR in ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader/lib?{"ident":"postcss","sourceMap":false}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":["C://xampp//htdocs//angular-laravel-hrms//HRMS2UI//src//styles"]}!./src/styles.scss Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (83)
But when I did:
npm rebuild node-sass
the error changed to:
ERROR in node_modules/@types/lodash/common/array.d.ts(37,24): error TS1005: ';' expected. node_modules/@types/lodash/common/array.d.ts(483,22): error TS1005: ';' expected. node_modules/@types/lodash/common/array.d.ts(483,41): error TS1005: ',' expected. node_modules/@types/lodash/common/array.d.ts(483,44): error TS1005: '(' expected.
I did npm i --package-lock-only
but the error is still there.
How do I get it resolved?
Thanks
If the version of node is wrong, you must downgrade node, or upgrade node-sass, until you have a compatible pair. If the node version is supported, you may just need to run:
npm rebuild node-sass
You can install types for an old version of typescript with using npm tags. For example lodash types for typescript 2.5
npm i -D @types/[email protected]
Then you run the following commands
npm rebuild node-sass
npm install --scripts-prepend-node-path
npm start
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With