Monday, 13 March 2017

AWS ubuntu npm ERR! weird error 8 when trying to npm start react app

I have seen a few questions (here was the first) with a similar issue and have followed what they said to fix, mainly the 2 solutions stated for this question:

$ whereis nodejs
$ ln -s [the path of nodejs] /usr/bin/node     

and/or

$ sudo apt-get install nodejs-legacy

I couldn't even get it to npm install without the symlink to the nodejs path

$ sudo ln -s /usr/bin/nodejs /usr/bin/node

But I was getting the error when I tried to start, so I tried the install:

portfolio$ sudo apt-get install nodejs-legacy
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  ax25-node libax25 libfile-copy-recursive-perl openbsd-inetd update-inetd
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  node
The following NEW packages will be installed:
  nodejs-legacy
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 14.6 kB of archives.
After this operation, 82.9 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us-west-1.ec2.archive.ubuntu.com/ubuntu/ trusty/universe nodejs-legacy all 0.10.25~dfsg2-2ubuntu1 [14.6 kB]
Fetched 14.6 kB in 0s (1,157 kB/s) 
(Reading database ... 59679 files and directories currently installed.)
Removing node (0.3.2-7.4) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Selecting previously unselected package nodejs-legacy.
(Reading database ... 59674 files and directories currently installed.)
Preparing to unpack .../nodejs-legacy_0.10.25~dfsg2-2ubuntu1_all.deb ...
Unpacking nodejs-legacy (0.10.25~dfsg2-2ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up nodejs-legacy (0.10.25~dfsg2-2ubuntu1) ...

I am still getting the same errors though, any insight would be appreciated as I continue to try to figure this issue out:

portfolio$ npm start

> web@0.0.0 start /home/ubuntu/delonga/portfolio
> babel-node tools/run start


module.js:340
    throw err;
          ^
Error: Cannot find module 'source-map'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/ubuntu/delonga/portfolio/node_modules/source-map-support/source-map-support.js:1:87)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
npm ERR! weird error 8
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! not ok code 0



via Alan DeLonga

No comments:

Post a Comment