Module Not Found \\fetch.js - module

Hi tried running "npm build run" and have an error:
at Object.<anonymous> (C:\Users\Owner\Desktop\developerFolio\fetch.js:4:1)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157: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: [ 'C:\Users\Owner\Desktop\developerFolio\fetch.js' ]

Related

Who can tell what the mistake is?

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:372:5)
at validateString (node:internal/validators:120:11)
at Object.extname (node:path:837:5)
at getOptions (C:\Users\skh43\Desktop\Тест сайт\node_modules\node-sass\bin\node-sass:228:40)
at Object.<anonymous> (C:\Users\skh43\Desktop\Тест сайт\node_modules\node-sass\bin\node-sass:408:15)
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: 'ERR_INVALID_ARG_TYPE'
}
Waiting for the debugger to disconnect...
PS C:\Users\skh43\Desktop\Тест сайт>
It says that the path should be a string, but no matter how much I try, I can't get it
Here is the file I was running
{
"name": "test_site",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"scss": "node-sass -watch scss -o css"
},
"author": "me",
"license": "ISC",
"dependencies": {
"node-sass": "^7.0.1",
"react-scripts": "^5.0.1"
}
}
I do not know what details I can add to the question so that it consists not only of code, but the site requires more text from me

vue cli project won't run - 'babel-code-frame'

I am trying to create the absolute basic new vue-cli project, on Linux. The generated project won't run. What am I doing wrong?
I installed the most recent vue cli
sudo npm install -g #vue/cli#4.5.0
I created a new project:
cd /tmp
vue create project1
I selected the default presets.
I tried to run the project
$ cd project1
$ npm run serve
> project1#0.1.0 serve /tmp/project1
> vue-cli-service serve
INFO Starting development server...
ERROR Error: Cannot find module 'babel-code-frame'
Error: Cannot find module 'babel-code-frame'
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> (/usr/share/nodejs/eslint/lib/formatters/codeframe.js:8:19)
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)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at exports.loadModule (/tmp/project1/node_modules/#vue/cli-shared-utils/lib/module.js:79:14)
at api.chainWebpack.webpackConfig (/tmp/project1/node_modules/#vue/cli-plugin-eslint/index.js:59:26)
at webpackChainFns.forEach.fn (/tmp/project1/node_modules/#vue/cli-service/lib/Service.js:236:40)
at Array.forEach (<anonymous>)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project1#0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project1#0.1.0 serve 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! /home/kevin/.npm/_logs/2020-07-24T17_38_02_618Z-debug.log
My npm version is 6.14.7
$ npm --version
6.14.7
This is package.json after manually hacking in "#babel/code-frame" as suggested by Igor.
{
"name": "project1",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"vue": "^2.6.11"
},
"devDependencies": {
"#babel/code-frame": "^7.10.4",
"#vue/cli-plugin-babel": "~4.5.0",
"#vue/cli-plugin-eslint": "~4.5.0",
"#vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
I tried clearing down npm cache as per this ticket, but it didn't make a difference.
https://stackoverflow.com/questions/42308879/npm-err-code-elifecycle
I removed and reinstalled nodejs and npm to solve the problem.
sudo apt-get remove npm
sudo apt-get remove nodejs
Re-install
sudo apt-get update
sudo apt-get install nodejs npm

Heroku: Error: Cannot find module '/tmp/build_.../.yarn\releases\yarn-1.22.4.js'

I'm trying to use this Flask+Vue.js template, which is meant to be used with Heroku. I got it working, but I'm now trying to add Vuetify, and I'm seeing the error below when I try to push my code:
console output
(resolutewl) C:\Users\Nathan\Documents\resolutewl>git push heroku
Enumerating objects: 102, done.
Counting objects: 100% (102/102), done.
Delta compression using up to 4 threads
Compressing objects: 100% (71/71), done.
Writing objects: 100% (78/78), 1.29 MiB | 629.00 KiB/s, done.
Total 78 (delta 34), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: YARN_PRODUCTION=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=false
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 12.16.x
remote: engines.npm (package.json): unspecified (use default)
remote: engines.yarn (package.json): 1.22.4
remote:
remote: Resolving node version 12.16.x...
remote: Downloading and installing node 12.16.3...
remote: Using default npm version: 6.14.4
remote: Resolving yarn version 1.22.4...
remote: Downloading and installing yarn (1.22.4)...
remote: internal/modules/cjs/loader.js:960
remote: throw err;
remote: ^
remote:
remote: Error: Cannot find module '/tmp/build_88865a3fc4f26d1803aa9da629126610/.yarn\releases\yarn-1.22.4.js'
remote: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
remote: at Function.Module._load (internal/modules/cjs/loader.js:840:27)
remote: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
remote: at internal/main/run_main_module.js:18:47 {
remote: code: 'MODULE_NOT_FOUND',
remote: requireStack: []
remote: }
remote: Installed yarn
remote: internal/modules/cjs/loader.js:960
remote: throw err;
remote: ^
remote:
remote: Error: Cannot find module '/tmp/build_88865a3fc4f26d1803aa9da629126610/.yarn\releases\yarn-1.22.4.js'
remote: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
remote: at Function.Module._load (internal/modules/cjs/loader.js:840:27)
remote: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
remote: at internal/main/run_main_module.js:18:47 {
remote: code: 'MODULE_NOT_FOUND',
remote: requireStack: []
remote: }
remote: internal/modules/cjs/loader.js:960
remote: throw err;
remote: ^
remote:
remote: Error: Cannot find module '/tmp/build_88865a3fc4f26d1803aa9da629126610/.yarn\releases\yarn-1.22.4.js'
remote: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
remote: at Function.Module._load (internal/modules/cjs/loader.js:840:27)
remote: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
remote: at internal/main/run_main_module.js:18:47 {
remote: code: 'MODULE_NOT_FOUND',
remote: requireStack: []
remote: }
remote:
remote: -----> Restoring cache
remote: Caching has been disabled because NODE_MODULES_CACHE=false
remote:
remote: -----> Installing dependencies
remote: Installing node modules (yarn.lock)
remote: internal/modules/cjs/loader.js:960
remote: throw err;
remote: ^
remote:
remote: Error: Cannot find module '/tmp/build_88865a3fc4f26d1803aa9da629126610/.yarn\releases\yarn-1.22.4.js'
remote: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
remote: at Function.Module._load (internal/modules/cjs/loader.js:840:27)
remote: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
remote: at internal/main/run_main_module.js:18:47 {
remote: code: 'MODULE_NOT_FOUND',
remote: requireStack: []
remote: }
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: Some possible problems:
remote:
remote: - A module may be missing from 'dependencies' in package.json
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to resolutewl.
remote:
To https://git.heroku.com/resolutewl.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/resolutewl.git'
package.json
{
"name": "vue_app",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --open",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"postinstall": "yarn build"
},
"dependencies": {
"#vue/cli-service-global": "^4.4.1",
"axios": "^0.19.2",
"sass": "^1.26.8",
"sass-loader": "8.0.2",
"vue": "^2.6.11",
"vue-router": "^3.3.2",
"vuetify": "^2.2.33",
"vuex": "^3.4.0"
},
"devDependencies": {
"#vue/cli-plugin-babel": "^4.4.1",
"#vue/cli-plugin-eslint": "^4.4.1",
"#vue/cli-service": "^4.4.1",
"#vue/eslint-config-standard": "^5.1.2",
"eslint": "^7.2.0",
"eslint-plugin-import": "^2.21.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^6.2.2",
"lint-staged": "^10.2.9",
"vue-cli-plugin-vuetify": "~2.0.5",
"vue-template-compiler": "^2.6.11",
"vuetify-loader": "^1.4.4"
},
"babel": {
"presets": [
"#vue/app"
]
},
"eslintConfig": {
"root": true,
"extends": [
"plugin:vue/essential",
"#vue/standard"
]
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"engines": {
"node": "12.16.x",
"yarn": "1.22.4"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.js": [
"vue-cli-service lint",
"git add"
],
"*.vue": [
"vue-cli-service lint",
"git add"
]
}
}
What I've tried
I've gone through the steps here: Heroku Dev Center - Troubleshooting Node.js Deploys
If you have a .yarnrc file, delete it and try again.
I came across this when I changed yarn versions locally to a 1.x version. That automatically generated a .yarnrc file, which I then mistakenly committed to the repo.
The correct file for yarn config is .yarnrc.yml (ref).

eslint error from vue Error: Cannot find module 'eslint/lib/ast-utils'

I'm trying to run eslint on my code but am getting the following error:
> vue-cli-service lint; vue-cli-service test
ERROR Error: Cannot find module 'eslint/lib/ast-utils'
Referenced from: /Users/username/Development/project/tests/e2e/.eslintrc
Error: Cannot find module 'eslint/lib/ast-utils'
Referenced from: /Users/username/Development/project/tests/e2e/.eslintrc
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/username/Development/project/node_modules/eslint-plugin-protractor/lib/rules/array-callback-return.js:8:16)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
Versions:
"#babel/core": "^7.1.0",
"#babel/plugin-syntax-flow": "^7.0.0",
"#babel/preset-flow": "^7.0.0",
"#babel/plugin-transform-flow-strip-types": "^7.0.0",
"#vue/cli-plugin-babel": "^3.0.5",
"#vue/cli-plugin-eslint": "^3.0.5",
"#vue/cli-plugin-unit-jest": "^3.0.5",
"#vue/cli-service": "^3.0.5",
"#vue/test-utils": "^1.0.0-beta.25",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.2",
"eslint": "^5.6.1",
"eslint-config-sagely": "git+ssh://git#github.com/sagely/eslint-config-sagely.git",
"eslint-plugin-flowtype": "^2.50.3",
"eslint-plugin-flowtype-errors": "^3.6.0",
"eslint-plugin-vue": "^4.7.1",
What am I missing here?
In my case I got a similar Error: Cannot find module 'eslint/lib/rules/utils/ast-utils' and I needed to upgrade eslint - v5 to v7 worked for me.
The easiest way to resolve this would be removing your node_modules folder and do npm install again or install all packages again using whatever package manager you use.

Cannot find module 'detox/runners/jest/adapter' from 'init.js' - Detox

I am trying to run Detox test and found this error "Cannot find module 'detox/runners/jest/adapter' from 'init.js'"
node_modules/.bin/jest e2e --config=e2e/config.json --maxWorkers=1
--testNamePattern='^((?!:ios:).)*$' FAIL e2e/firstTest.spec.js ● Test suite failed to run
Cannot find module 'detox/runners/jest/adapter' from 'init.js'
at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:191:17)
at Object.<anonymous> (init.js:3:13)
Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0
total Time: 1.27s Ran all test suites matching /e2e/i with
tests matching "^((?!:ios:).)*$". child_process.js:643
throw err;
^
Error: Command failed: node_modules/.bin/jest e2e
--config=e2e/config.json --maxWorkers=1 --testNamePattern='^((?!:ios:).)*$'
at checkExecSyncError (child_process.js:603:11)
at Object.execSync (child_process.js:640:13)
at runJest (/Users/neeraj.kumar/Neeraj/Projects/sampleApp/node_modules/detox/local-cli/detox-test.js:135:6)
at run (/Users/neeraj.kumar/Neeraj/Projects/sampleApp/node_modules/detox/local-cli/detox-test.js:78:7)
at Object. (/Users/neeraj.kumar/Neeraj/Projects/sampleApp/node_modules/detox/local-cli/detox-test.js:180:1)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
Command : detox test -c android.emu.debug
package.json:
{
"name": "sampleApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test-android": "detox build --configuration android.emu.debug && detox test --configuration android.emu.debug -l verbose"
},
"dependencies": {
"npm": "^6.1.0",
"react": "16.2.0",
"react-native": "0.53.3"
},
"devDependencies": {
"babel-jest": "21.2.0",
"babel-plugin-transform-react-jsx-source": "^6.22.0",
"detox": "7.4.0",
"jest": "21.2.1",
"react-test-renderer": "16.0.0-beta.5"
},
"detox": {
"test-runner": "jest",
"specs": "e2e",
"runner-config": "e2e/config.json",
"configurations": {
"android.emu.debug": {
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
"type": "android.emulator",
"name": "Nexus_5X_API_28_x86"
}
}
}
}
What could be the Problem? When I see my node_module >> detox folder, I could not see runner folder. Did I miss something?
Update your detox dependency to ^8.0.0.