Kid_Learning_C
Kid_Learning_C

Reputation: 3631

unable to run npm start or npm install in Ubuntu 18.04

I'm new to front-end development and nodejs / react so please bear with me if this is a silly question.

I was trying to learn by using this open project: https://github.com/ilhammeidi/boss-lite

In the readme, it states pretty clearly on how to deploy this react project:

However I cannot get even the first npm install step right on my Ubuntu 18.04:

john@home:~/learnFE/code/boss-lite$ npm install 
npm WARN deprecated [email protected]: You can now upgrade to @material-ui/pickers. Documentation for v2 can be found at https://material-ui-pickers-v2.dmtr-kovalenko.now.sh/
npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated [email protected]: This project is no longer maintained.
npm ERR! Linux 5.4.0-67-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror     at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror     at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror     at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror     at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror     at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror     at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror     at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror     at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/john/learnFE/code/boss-lite/npm-debug.log
john@home:~/learnFE/code/boss-lite$ 

I searched the error and found this post in which this is a widely accepted solution: run sudo npm install -g npm@latest, however:

john@home:~/learnFE/code/boss-lite$ sudo npm install -g npm@latest
▌ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine [email protected]: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"3.5.2"})
/usr/local/lib
└── (empty)

npm ERR! Linux 5.4.0-67-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "npm@latest"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! path /usr/local/lib/node_modules/.staging/@npmcli/ci-detect-c7bf9552
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/@npmcli/ci-detect-c7bf9552' -> '/usr/local/lib/node_modules/npm/node_modules/@npmcli/ci-detect'
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/@npmcli/ci-detect-c7bf9552' -> '/usr/local/lib/node_modules/npm/node_modules/@npmcli/ci-detect'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /home/john/learnFE/code/boss-lite/npm-debug.log
npm ERR! code 1
john@home:~/learnFE/code/boss-lite$ 

It says This is most likely not a problem with npm itself. How to proceed then? The linux kernel version also appears:
npm ERR! Linux 5.4.0-67-generic

I'm clueless right now and it is so frustrating to be failing at the simple and basic step...

Maybe it is because the github project itself is flawed? I guess not.

Probably this is some really basic stuff. Any help?

Upvotes: 1

Views: 1794

Answers (1)

RukshanJS
RukshanJS

Reputation: 966

These errors were simply due to the packages being obsolete for your OS.

Just update them by running,

npm update --force

This will install the latest versions of these packages. This will take a while depending on your internet connection.

Then run npm start and it works.

Upvotes: 1

Related Questions