node.js - npm start gives weird error 8 with Unexpected token ILLEGAL -


i getting weird error 8 below output while doing $ npm start

syntaxerror: unexpected token illegal @ module._compile (module.js:439:25) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ function.module.runmain (module.js:497:10) @ startup (node.js:119:16) @ node.js:902:3 npm err! weird error 8 npm warn failure might due use of legacy binary "node" npm warn further explanations, please read /usr/share/doc/nodejs/readme.debian  npm err! not ok code 0 

npm -v 1.3.10

node -v v0.10.25

i have installed nodejs-legacy

$ node /usr/bin/node  $ nodejs /usr/bin/nodejs 

can please it.

i trying run react-jsonschema-form or word-finder (https://github.com/amirrajan/word-finder) on ubuntu 14.04

you using node 0.10 - lts version 4.5.0 , current version 6.6.0. consider upgrading node because using outdated version. node 0.10 released on march 2013, maintainence period ends in week (on october 1, 2016) , no longer updates, see: https://github.com/nodejs/lts#lts_schedule

according package.json in github.com/mozilla-services/react-jsonschema-form required node version @ least 6.x , npm 2.14.7. trying run on node v0.10.25 , npm 1.3.10. shouldn't expect work.

to install modern version of node, can either download binary version https://nodejs.org/ or can build source, example procedure similar one:

if want have node installed in /usr/local , available /usr/local/bin/node can this:

# change dir home: cd ~ # download source: curl -o https://nodejs.org/dist/v6.6.0/node-v6.6.0.tar.gz # extract archive: tar xzvf node-v6.6.0.tar.gz # go extracted dir: cd node-v6.6.0 # configure installation: ./configure --prefix=/usr/local # build , test: make && make test # install: sudo make install # make sure have /usr/local/bin in $path before /usr/bin: # add .profile or .bashrc: path="/usr/local/bin:$path" 

or if want able have few versions installed @ same time, symlink default 1 use:

# change dir home: cd ~ # download source: curl -o https://nodejs.org/dist/v6.6.0/node-v6.6.0.tar.gz # extract archive: tar xzvf node-v6.6.0.tar.gz # go extracted dir: cd node-v6.6.0 # configure installation: ./configure --prefix=/opt/node-v6.6.0 # build , test: make && make test # install: sudo make install # make symlink version: sudo ln -svf /opt/node-v6.6.0 /opt/node # make sure have /opt/node/bin in $path before /usr/bin # add .profile or .bashrc: path="/opt/node/bin:$path" 

see this answer more info.


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -