stencil-cli icon indicating copy to clipboard operation
stencil-cli copied to clipboard

Npm install error

Open jacobnoah opened this issue 3 years ago • 6 comments

Expected behavior

I expected to be able to install stencil-cli no problem.

Actual behavior

Using correct versions of npm and node I keep getting this error in npm: npm ERR! code ENOENT npm ERR! syscall rename npm ERR! path ../node/v10.24.1/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@bigcommerce/stencil-styles/node_modules/lodash npm ERR! dest ../.nvm/versions/node/v10.24.1/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@bigcommerce/stencil-styles/node_modules/.lodash.DELETE npm ERR! errno -2 npm ERR! enoent ENOENT: no such file or directory, rename '../.nvm/versions/node/v10.24.1/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@bigcommerce/stencil-styles/node_modules/lodash' -> '../.nvm/versions/node/v10.24.1/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@bigcommerce/stencil-styles/node_modules/.lodash.DELETE' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent

I have done everything from uninstalling npm and node as well as removing package-lock.json and node_modules folder. I have tried installing it locally and globally and get the same error. I have tried all solutions online including quitting all instances of nodes running. I have even restarted my computer and have 0 applications running and I still get the same error. I am unsure of why this keeps happening on my system. I should specify I have a Mac.

Steps to reproduce behavior

doing npm i -g @bigcommerce/stencil-cli or npm i @bigcommerce/stencil-cli

jacobnoah avatar Jun 07 '21 14:06 jacobnoah

Hi @jacobnoah,

Could you please provide node version by typing node -v?

jairo-bc avatar Jun 29 '21 14:06 jairo-bc

@jacobnoah I encountered a similar issue when using npm version 7. In my case, npm was unable to resolve the 'mkdir' module. If I downgrade to npm version 6, it installs no problem.

Perhaps you could try downgrading to version 6 and see if that resolves your issue.

@jairo-bc any idea what may be causing this issue? My gut feeling is it has to do with on or more outdated dependencies but I'm not entirely sure that's what it is.

Here's the output from running npm install -g @bigcommerce/stencil-cli with npm v7.23.0 on node v12.22.6:

npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/pinpoint'
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: Removed event-stream from gulp-header
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/formula'
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
npm WARN deprecated @hapi/[email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version contains severe security issues and defects and should not be used! Please upgrade to the latest version of @hapi/hapi or consider a commercial license (https://github.com/hapijs/hapi/issues/4114)
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /Users/cory/.nvm/versions/node/v12.22.6/bin/node /Users/cory/.nvm/versions/node/v12.22.6/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/cory/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /Users/cory/.npm/_cacache/tmp/git-cloneXiO7cf
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c node scripts/install.js
npm ERR! npm ERR! internal/modules/cjs/loader.js:818
npm ERR! npm ERR!   throw err;
npm ERR! npm ERR!   ^
npm ERR! npm ERR! 
npm ERR! npm ERR! Error: Cannot find module 'mkdirp'
npm ERR! npm ERR! Require stack:
npm ERR! npm ERR! - /Users/cory/.npm/_cacache/tmp/git-cloneXiO7cf/scripts/install.js
npm ERR! npm ERR!     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
npm ERR! npm ERR!     at Function.Module._load (internal/modules/cjs/loader.js:667:27)
npm ERR! npm ERR!     at Module.require (internal/modules/cjs/loader.js:887:19)
npm ERR! npm ERR!     at require (internal/modules/cjs/helpers.js:74:18)
npm ERR! npm ERR!     at Object.<anonymous> (/Users/cory/.npm/_cacache/tmp/git-cloneXiO7cf/scripts/install.js:7:13)
npm ERR! npm ERR!     at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR! npm ERR!     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! npm ERR!     at Module.load (internal/modules/cjs/loader.js:863:32)
npm ERR! npm ERR!     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR! npm ERR!     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
npm ERR! npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR! npm ERR!   requireStack: [
npm ERR! npm ERR!     '/Users/cory/.npm/_cacache/tmp/git-cloneXiO7cf/scripts/install.js'
npm ERR! npm ERR!   ]
npm ERR! npm ERR! }
npm ERR! 
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /Users/cory/.npm/_logs/2021-09-15T22_34_28_195Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/cory/.npm/_logs/2021-09-15T22_34_30_530Z-debug.log

corygottschalk avatar Sep 15 '21 22:09 corygottschalk

Fixed by downgrading npm back to v6 - errors on v7 as above post showed.

ImTheDeveloper avatar Sep 25 '21 09:09 ImTheDeveloper

Check NPM version using npm -v If it's not version 6 downgrade or upgrade it by doing npm i -g npm@6 They should put this in their prerequisites as there's no way to find about this.

Nihir10dec avatar Jan 04 '22 13:01 Nihir10dec

@jairo-bc not a fix, but at least there might be some advanced warning that you need npm@6 would be to add an engines declaration to package.json

"engines" : { 
    "node": "^10.17 || ^12",
    "npm": ">=v6.14.6 <7.0.0"
  }
``

steve-ross avatar Jan 19 '22 21:01 steve-ross

@steve-ross Thanks for suggestion! https://github.com/bigcommerce/stencil-cli/pull/846

jairo-bc avatar Jan 20 '22 15:01 jairo-bc