'Node modules not installing on ionic 3 project
I have an ionic 3 project, which I worked on 02 Jun 2021. Now after cloning the project from Github, I tried to run npm install. It installs the node_modules directory but after a few seconds node_modules directory disappears
I tried with a fresh ionic project which is running fine. Can anyone help me?
Here is the error code
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
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]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-node-resolve.
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-commonjs.
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]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Please migrate to Workbox: https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
npm WARN deprecated [email protected]: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
npm WARN deprecated [email protected]: Package is unsupported. Please use the `admob-plus-cordova` package instead.
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! path D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli 'D:\\xampp\\htdocs\\micro-wallet\\micro-wallet-app\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed python2 Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python
npm ERR! gyp verb `which` failed at getNotFoundError (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed python Error: not found: python
npm ERR! gyp verb `which` failed at getNotFoundError (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb could not find "python". checking python launcher
npm ERR! gyp verb could not find "python". guessing location
npm ERR! gyp verb ensuring that file exists: C:\Python27\python.exe
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack at PythonFinder.failNoPython (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\node-gyp\lib\configure.js:484:19)
npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\node-gyp\lib\configure.js:509:16)
npm ERR! gyp ERR! stack at callback (D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\graceful-fs\polyfills.js:299:20)
npm ERR! gyp ERR! stack at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\xampp\\htdocs\\micro-wallet\\micro-wallet-app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd D:\xampp\htdocs\micro-wallet\micro-wallet-app\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.14.2
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm ERR! A complete log of this run can be found in:
Solution 1:[1]
Thank you for reaching this post. After 5 days of investigation, I have solved the issue. I need to downgrade the node version. But, instead of downgrading the version, I have used nvm (node.js version management utility). And finally, I am able to install node modules in my ionic project of version 3. And it's running perfectly.
Here are the steps:
- I have installed nvm for my windows pc (https://github.com/coreybutler/nvm-windows)
- After installing nvm run several commands
run this command to check how many node version is installed on your pc
nvm list
run this command to install any older versions of node js. Suppose you want to install the older 10.0.0 version.
nvm install 10.0.0
run this command to switch to any node js version
nvm use 10.0.0
Cheers
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Samiron Barai |