Closed magician11 closed 6 years ago
Ve a tu carperta node_modules C:\Program Files\nodejs\node_modules. Elimina la carpeta npm, con todo su contendió, instala la versión que desees.
I had the same issue. I was using node 8.11.0. Now I have downgraded it to 6.0.0 and it will work. Thanks for your valuable suggestions
For my Mac, I had to remove node/npm/npm settings/reinstall node LTS/Cordova -- only 1 sudo command should be required.
remove node and global node_modules
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}
remove npm user settings from your profile
rm -rf ~/.npm
rm -rf ~/.npm-global
rm -rf ~/.npmrc
nano ~/.profile <-- remove any path additions regarding NPM and save
install NVM
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
install Node LTS with NVM
nvm install --lts
update ionic project by removing any previous node_modules, reinstall ionic/cordova
cd {project path}
rm -rf node_modules
npm install -g ionic cordova
finally, add iOS platform works...
cordova platform add ios
All of this setup my Mac with the following versions:
cli packages: (/Users/{xxxxxx}/.nvm/versions/node/v8.11.2/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.9
Cordova Platforms : ios 4.5.4
Ionic Framework : ionic-angular 3.3.0
System:
Node : v8.11.2
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 9.3.1 Build version 9E501
Environment Variables:
ANDROID_HOME : not set
I had the same issue with Node 10.3.0 (Windows 10). I followed the instructions for handling a similar error here and it fixed both errors. The command was: npm install --save-dev grunt-google-cdn
Had this issue using Win 10 Wsl, node v. 9.3.0, npm v. 6.1.0 & gulp 3.9 and what helped using gulp again was npm audit fix
Using n for version management. What fixed it for me:
curl -0 -L https://npmjs.com/install.sh | sudo sh
sudo npm cache clean
@aromot where can i find \global_modules\node_modules ?
@QuocCong after removing i /c/Users/JoSuper/AppData/Roaming/npm/ get this
$ cordova platform add android@6 bash: /c/Users/JoSuper/AppData/Roaming/npm/cordova: No such file or directory
@josuper The "global_modules" folder is located at the root of your NodeJS installation. I can't tell where it is exactly, I'm using a custom folder instead of the default path proposed by the installation.
Downgrading the node version worked for me. I used volta-cli to try a few different node versions until I found one that works.
C:\xampp\htdocs\DICA\dica-upload-ok-calendario-ko>npm run dev
dica-upload-ok-calendario-ko@1.0.0 dev C:\xampp\htdocs\DICA\dica-upload-ok-calendario-ko npm run development
internal/modules/cjs/loader.js:638 throw err; ^
Error: Cannot find module 'internal/util/types'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at evalmachine.npm run development
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the dica-upload-ok-calendario-ko@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Utilizador\AppData\Roaming\npm-cache_logs\2019-10-14T16_25_58_379Z-debug.log
C:\xampp\htdocs\DICA\dica-upload-ok-calendario-ko>yarn install 'yarn' is not recognized as an internal or external command, operable program or batch file.
Can someone help me?
Upgrading the node version to the stable one worked for me. npm cache clean -f npm install n stable -g npm cache clean -f
I know it's closed but i want to add a alternative solution for this problem.
Yes, node version update works every time. Because it's related with npm package version. Real problem is npm version to old for this. You can update npm version with node version. For example: nodejs.org download page said that: "Latest LTS Version: 12.14.1 (includes npm 6.13.4)". If you uninstall npm in your global and after that install again, you will fix this issue.
This is what I get when running
nodemon
with no arguments.I'm using node 8.8.1