• Register
0 votes
86 views

Problem :

I am trying to learn the Node JS. I have already installed my Node.JS (9.4.0) with the help of below commands.

$brew install node      
$node -v                                                             $v0.12.7

Then I executed below command

 npm install -g grunt-cli for test. But it gave me below error:

/usr/local/lib/node_modules/npm/lib/utils/unsupported.js:28
        console.error(`a bug known to break npm. Please update to at least ${r
                      ^
SyntaxError: Unexpected token ILLEGAL
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:19:21
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:92:3)
    at Module._compile (module.js:460:26)

How can I fix above error?

8 4 2
2,300 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I have faced such issues in the past.

One of the cause of the issue is the incorrect path. You need to crosscheck your path.

It is possible that you are using the old version of Node JS which is not supporting the template litterels. So you can try to upgrade to the latest version of Node JS.

If above solutions are  not working for you then you should remove all the node/npm/gulp files from /usr/local area.

Then you should use "rpm -e" to remove all the nodejs packages and the npm

After that use below commands

yum install nodejs npm

npm install -g n

n 4.7.0

npm install -g gulp

It will fix your issue.

5 2 1
4,980 points

Related questions

1 vote
1 answer 20 views
20 views
Problem : I tried installing but that didn't work , Its throw this error : node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: Cannot find module 'mongoose' at Function._resolveFilename (module.js:334:11) at Function._load (module.js ... Function._load (module.js:310:12) at Module.require (module.js:357:17) Does anyone know what it is and how to solve it? Thanks
asked Mar 29 Shovo210 14k points
0 votes
1 answer 22 views
22 views
Problem: bower' is not recognized as an internal or external command, operable program or batch file.
asked Feb 19 Lucky Guy 1.5k points
0 votes
1 answer 119 views
119 views
Problem: gulp' is not recognized as an internal or external command, operable program or batch file.
asked Feb 18 Lucky Guy 1.5k points
0 votes
1 answer 35 views
35 views
Problem: node' is not recognized as an internal or external command, operable program or batch file.
asked Feb 18 Lucky Guy 1.5k points
0 votes
1 answer 5 views
5 views
Problem: What are my options for dealing with this issue? composer is not installed. please run "php composer.phar update" in the root to install composer
asked Apr 1 rakib1 51.5k points
0 votes
1 answer 3 views
3 views
Problem: I tried to install grunt on a mac with Yosemite. node is already installed in the newest version. If I type "node -v" in the terminal I get the line v0.12.5. thats good. But when I want to install something with npm I get only a error. I tried " ... 32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) Someone knows what's the problem or better a solution?
asked 4 days ago Atik03 10.1k points
0 votes
1 answer 381 views
0 votes
1 answer 3 views
3 views
Problem: Help me to install npm in visual studio code.
asked 6 days ago zayed1 35.6k points
0 votes
2 answers 646 views
646 views
Problem : I want to to run my NodeJS version with the nvm but getting following error: $ nvm use v4.2.4 nvm is not compatible with the npm config "prefix" option: currently set to "/Users/z/.npm-global"Run `npm config delete prefix` or `nvm use --delete- ... it. I have set the prefix on purpose to avoid the sudo npm How can I use nvm without losing the prefix for my globally installed packages?
asked Nov 29, 2019 alecxe 7.5k points