VUE Error: Cannot find module 'lru-cache' - javascript

Good morning, first I would like to apologize for my English.
I am having a problem when creating a project to follow, I am taking the following steps.
STEP 1: npm install #vue/cli
STEP 2: vue create myproject
In the second step, I have the following error.
PS C:\Users\Bruno\Desktop\vue\VUE-CLI> vue create myproject
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'lru-cache'
Require stack:
- C:\Users\Bruno\AppData\Roaming\npm\node_modules\#vue\cli\node_modules\#vue\cli-shared-utils\lib\env.js
- C:\Users\Bruno\AppData\Roaming\npm\node_modules\#vue\cli\node_modules\#vue\cli-shared-utils\index.js
- C:\Users\Bruno\AppData\Roaming\npm\node_modules\#vue\cli\bin\vue.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\Users\Bruno\AppData\Roaming\npm\node_modules\#vue\cli\node_modules\#vue\cli-shared-utils\lib\env.js:4:13)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Bruno\\AppData\\Roaming\\npm\\node_modules\\#vue\\cli\\node_modules\\#vue\\cli-shared-utils\\lib\\env.js',
'C:\\Users\\Bruno\\AppData\\Roaming\\npm\\node_modules\\#vue\\cli\\node_modules\\#vue\\cli-shared-utils\\index.js',
'C:\\Users\\Bruno\\AppData\\Roaming\\npm\\node_modules\\#vue\\cli\\bin\\vue.js'
]
}
PS C:\Users\Bruno\Desktop\vue\VUE-CLI>

Try using npx maybe? Ensuring you have the latest updates
npx #vue/cli create my-project
Is the folder you intend to install the project into Vue/vue-cli? Don't know if anything n there is affecting it

Related

Cannot find module 'discord.js', console reporting

I am very new using discord's javascript
This is also my first time posting on stackoverflow!
Anyway
Here's the full error
Error: Cannot find module 'discord.js'
Require stack:
- /home/runner/multiple-purpose-discord-bot-like-carlbot/xp.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/home/runner/multiple-purpose-discord-bot-like-carlbot/xp.js:1:17)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/home/runner/multiple-purpose-discord-bot-like-carlbot/xp.js' ]
}
To my limited knowledge, this is either i made a typo
OR some package is outdated, here's the full packages list
I also suspect that i incorrectly implemented the amethyste-api i am using, here's my code
It's in a config file, should've i put const mySecret = process.env['ame'] in the main file instead?, I do need it to be in the config for ease of access
npm install discord.js (manually through console/shell)
did do some stuff but stil didn't work
npm xp.js (manually through console/shell)
this is what i am supposed to run on start manually, that what gives the error
You could run the following commands one after the other:
`npm init`
and then
`npm i discord.js`

missing ponyfills when building an Angular solution using the symbol-observable library

Trying to build (compile) an Angular 13 Ionic 6 solution after a migration to capacitor 4 (from capacitor 3) and a full npm cleanup and re-installation, Getting:
Error: Cannot find module './ponyfill.js'
Require stack:
- C:\Users\morsa\Documents\IDrive-Sync\Dev Env\Projects\simplify-pilot\node_modules\symbol-observable\lib\index.js
- C:\Users\morsa\Documents\IDrive-Sync\Dev Env\Projects\simplify-pilot\node_modules\#angular\cli\lib\init.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\morsa\Documents\IDrive-Sync\Dev Env\Projects\simplify-pilot\node_modules\symbol-observable\lib\index.js:7:17)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\morsa\\Documents\\IDrive-Sync\\Dev Env\\Projects\\simplify-pilot\\node_modules\\symbol-observable\\lib\\index.js',
'C:\\Users\\morsa\\Documents\\IDrive-Sync\\Dev Env\\Projects\\simplify-pilot\\node_modules\\#angular\\cli\\lib\\init.js'
]
}
[ERROR] An error occurred while running subprocess ng.
ng.cmd run app:build exited with exit code 1.
I guess this symbol-observable is used in rxjs (at least).
I tried manually installing:
npm i ponyfill
This did install ponyfill 0.0.1
However, still getting the above error.
Any pointers on how to unstuck me? can't build the app...

Node js: Error: Cannot find module 'mime-types/node_modules/mime-db'

I followed a tutorial to create a CRUD App with Nodejs, I finished the project and everything worked fine. After I tried to move all the files and folders to a new folderand I destroyed everything.
Now when I try to run node app.js the following happen:
enter code herinternal/modules/cjs/loader.js:797
throw err;
^
Error: Cannot find module 'mime-types/node_modules/mime-db'
Require stack:
- C:\Users\Costis\Documents\Code\Vue\Mongodb_app\server\node_modules\mime-types\index.js
- C:\Users\Costis\Documents\Code\Vue\Mongodb_app\server\node_modules\accepts\index.js
- C:\Users\Costis\Documents\Code\Vue\Mongodb_app\server\node_modules\express\lib\request.js
- C:\Users\Costis\Documents\Code\Vue\Mongodb_app\server\node_modules\express\lib\express.js
- C:\Users\Costis\Documents\Code\Vue\Mongodb_app\server\node_modules\express\index.js
- C:\Users\Costis\Documents\Code\Vue\Mongodb_app\server\app.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (C:\Users\Costis\Documents\Code\Vue\Mongodb_app\server\node_modules\mime-types\index.js:15:10)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Costis\\Documents\\Code\\Vue\\Mongodb_app\\server\\node_modules\\mime-types\\index.js',
'C:\\Users\\Costis\\Documents\\Code\\Vue\\Mongodb_app\\server\\node_modules\\accepts\\index.js',
'C:\\Users\\Costis\\Documents\\Code\\Vue\\Mongodb_app\\server\\node_modules\\express\\lib\\request.js',
'C:\\Users\\Costis\\Documents\\Code\\Vue\\Mongodb_app\\server\\node_modules\\express\\lib\\express.js',
'C:\\Users\\Costis\\Documents\\Code\\Vue\\Mongodb_app\\server\\node_modules\\express\\index.js',
'C:\\Users\\Costis\\Documents\\Code\\Vue\\Mongodb_app\\server\\app.js'
]e
Any suggestion?
You probably have to make a clean install your dependencies again with npm install, as you might have broken some symlinks (just assuming as I'm not a Windows user).
You can manually delete your node_modules folder and run npm install, or if you have an existing package-lock.json, use npm ci to install exactly the same versions of deps you had before.

Node - Tried to run the file "server.js" through CLI by typing node server.js but it shows message as Cannot find module

Find Visual Studio Code application where I tried to run the file. Things look fine but it says cannot find module. Find my terminal output below along with screenshot in "Node Program"
F:\Git Clone\Node.js_From 31Oct2019\IBM-Developer\Node.js\Course\Unit-6>node server.js
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'sqlite3'
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 Object.<anonymous> (F:\Git Clone\Node.js_From 31Oct2019\IBM-Developer\Node.js\Course\Unit-6\utils\utils.js:23:17)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
Node Program
You have to run npm i and then restart your application and vs code.
Install NPM by typing npm i and then restart your application

Get a error missing modules on the terminal

I want to make a new project running npm install -g create-react-app on the folder directory. After doing this I get the following error:
module.js:487
throw err;
^
Error: Cannot find module '../package.json'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:30:15
at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:92:3)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
Your question is not very precise. You should give more details about what you are doing.
Still, here are some suggestions. Make sure:
You run the command from within the folder, where your package.json is located.
If you have not created a package.json yet, run npm init
Your package.json is a valid format and readable

Categories

Resources