tinom9
tinom9

Reputation: 399

What is causing a npm install nuxt error?

I have just started a Nuxt project on WSL running Ubuntu 20.04.

I am using Node.js LTS/Fermium and I installed some dependencies for the project, but when I try to install Nuxt itself it retrieves some errors and I cannot find the cause:

So, when I do npm install nuxt the following errors show up:

Debugger attached.
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated [email protected]: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /home/tino/frontend/hanja/node_modules/deasync
npm ERR! command failed
npm ERR! command sh -c node ./build.js
npm ERR! Debugger attached.
npm ERR! Debugger attached.
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.8.5 found at "/usr/bin/python3"
npm ERR! (node:5914) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/tino/frontend/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/tino/frontend/hanja/node_modules/deasync/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/tino/frontend/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/tino/.cache/node-gyp/16.3.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/tino/.cache/node-gyp/16.3.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/tino/frontend/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/tino/.cache/node-gyp/16.3.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/tino/frontend/hanja/node_modules/deasync',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Debugger attached.
npm ERR! Waiting for the debugger to disconnect...
npm ERR! gyp: Call to 'node -p "require('node-addon-api').include"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/home/tino/frontend/node_modules/node-gyp/lib/configure.js:351:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.4.72-microsoft-standard-WSL2
npm ERR! gyp ERR! command "/home/tino/.nvm/versions/node/v16.3.0/bin/node" "/home/tino/frontend/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /home/tino/frontend/hanja/node_modules/deasync
npm ERR! gyp ERR! node -v v16.3.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok 
npm ERR! Waiting for the debugger to disconnect...
npm ERR! Build failed
npm ERR! Waiting for the debugger to disconnect...

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/tino/.npm/_logs/2021-06-22T15_14_10_385Z-debug.log
Waiting for the debugger to disconnect...

I have just started learning Nuxt but I cannot figure out what it causing the error.

Upvotes: 2

Views: 3014

Answers (2)

Seyed Abbas Seyedi
Seyed Abbas Seyedi

Reputation: 416

Just try to remove yarn.lock and reinstall again using yarn install.

Upvotes: 0

tinom9
tinom9

Reputation: 399

I finally realized that I had to install the build-essential package in Ubuntu and that was triggering the error:

sudo apt-get install build-essential

After that I was able to install Nuxt and everything is running fine so far!

Upvotes: 2

Related Questions