Click here to Skip to main content
15,879,096 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My node version is v9.3.0 and npm version is 5.6.0, and the angular-cli version being 1.6.1.

Whenever I run a project, I receive the following error :

Uncaught syntaxerror: use of 'const' in strict mode. 


Why is this error thrown ? How should I mitigate it ?

What I have tried:

I tried re-installing the node.js and angular-cli but in vain.
Posted
Updated 27-Feb-18 4:02am
Comments
Cyrus_Vivek 26-Feb-18 15:47pm    
Similar issue resolved below
https://github.com/sass/node-sass/issues/2100

1 solution

Below is how the issue was handled in Git, trying this may help you resolve the issue.

If you have a working version prior to update go to that installation and use:

npm shrinkwrap 
or npm shrinkwrap --dev

then a new file will be created

npm-shrinkwrap.json

Check that file and make sure dependencies are created. Normally this file has all the existing dependencies. Put that file in the folder which you run npm install inside. NPM will use the old versions and should work.

As an alternative you can remove all unrelated dependencies and keep only node-sass with request dependency.
"node-sass": {
        "version": "2.1.1",
        "from": "node-sass@>=2.0.1 <3.0.0",
        "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-2.1.1.tgz",
        "dependencies": {
          "request": {
            "version": "2.79.0",
            "from": "request@>=2.53.0 <3.0.0",
            "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz",
          },
        }
      },
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900