Who can tell what the mistake is? - npm

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

Related

> Build error occurred Error: Cannot find module 'next-pwa/cache'

I have some problem with my next.js application.
When I use any yarn/npm/next command I'm getting similar error:
> Build error occurred
Error: Cannot find module 'next-pwa/cache'
Require stack:
- D:\Criptic\next.config.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1026:15)
at mod._resolveFilename (C:\Users\carbo\AppData\Roaming\npm\node_modules\next\dist\build\webpack\require-hook.js:23:32)
at Module._load (node:internal/modules/cjs/loader:872:27)
at Module.require (node:internal/modules/cjs/loader:1092:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (D:\Criptic\next.config.js:3:24)
at Module._compile (node:internal/modules/cjs/loader:1205:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1259:10)
at Module.load (node:internal/modules/cjs/loader:1068:32)
at Module._load (node:internal/modules/cjs/loader:909:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'D:\\Criptic\\next.config.js' ]
}
This is my package.json
"scripts": {
"clean": "rimraf \"{node_modules,.next,out.cache}\"",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"prepare": "husky install"
},
"dependencies": {
"#headlessui/react": "^1.7.2",
"#hookform/resolvers": "^2.9.8",
"#tailwindcss/forms": "^0.5.3",
"#tailwindcss/typography": "^0.5.7",
"axios": "^0.27.2",
"classnames": "^2.3.2",
"date-fns": "^2.29.3",
"dayjs": "^1.11.5",
"ethers": "^5.7.1",
"framer-motion": "^7.3.6",
"jotai": "^1.8.4",
"js-cookie": "^3.0.1",
"little-state-machine": "^4.7.0",
"lodash": "^4.17.21",
"next": "12.3.1",
"next-pwa": "^5.6.0",
"next-seo": "^5.5.0",
"next-sitemap": "^3.1.22",
"next-themes": "^0.2.1",
"overlayscrollbars": "^1.13.1",
"overlayscrollbars-react": "^0.3.0",
"rc-slider": "^10.0.1",
"react": "18.2.0",
"react-countdown": "^2.3.2",
"react-dom": "18.2.0",
"react-dropzone": "^14.2.2",
"react-hook-form": "^7.36.0",
"react-query": "^3.39.2",
"react-share": "^4.4.0",
"react-table": "^7.7.0",
"react-use": "^17.3.2",
"recharts": "2.1.12",
"swiper": "^8.4.2",
"tiny-invariant": "^1.2.0",
"uuid": "^9.0.0",
"web3modal": "^1.9.9",
"yup": "^0.32.11"
},
next-pwa is here.
This is my next.config.js
/** #type {import('next').NextConfig} */
const runtimeCaching = require('next-pwa/cache');
const withPWA = require('next-pwa')({
dest: 'public',
disable: process.env.NODE_ENV === 'development',
runtimeCaching,
});
const nextConfig = withPWA({
reactStrictMode: true,
...(process.env.NODE_ENV === 'production' && {
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
}),
});
module.exports = nextConfig;
If it possible please help me. Thank you in advance for your help
I tried to find something in the documentation about this, however, the only thing that I found approximately correct is the following link, which does not have an exact solution to this problem https://nextjs.org/docs/messages/next-config-error

Module not found: Error: Can't resolve './node_modules/core-js/fn/promise' vue cli

I am using vue to write a chrome extension.I initialize my project through vue-cli-plugiin-chrome-extension.
I use promise in my background.js.When i run npm run build-watch,it throw the erro like this
Module not found: Error: Can't resolve './node_modules/core-js/fn/promise' in 'C:\Users\COD002\OneDrive\桌面\vue-test\test\src\entry'
(node:12064) UnhandledPromiseRejectionWarning: Error: Build failed with errors.
at Watching.handler (C:\Users\COD002\OneDrive\桌面\vue-test\test\node_modules\#vue\cli-service\lib\commands\build\index.js:207:23)
at C:\Users\COD002\OneDrive\桌面\vue-test\test\node_modules\webpack\lib\Watching.js:290:9
at Hook.eval [as callAsync] (eval at create (C:\Users\COD002\OneDrive\桌面\vue-test\test\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:24:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\Users\COD002\OneDrive\桌面\vue-test\test\node_modules\tapable\lib\Hook.js:18:14)
at Watching._done (C:\Users\COD002\OneDrive\桌面\vue-test\test\node_modules\webpack\lib\Watching.js:287:28)
at C:\Users\COD002\OneDrive\桌面\vue-test\test\node_modules\webpack\lib\Watching.js:209:21
at Compiler.emitRecords (C:\Users\COD002\OneDrive\桌面\vue-test\test\node_modules\webpack\lib\Compiler.js:919:5)
at C:\Users\COD002\OneDrive\桌面\vue-test\test\node_modules\webpack\lib\Watching.js:187:22
at C:\Users\COD002\OneDrive\桌面\vue-test\test\node_modules\webpack\lib\Compiler.js:885:14
at Hook.eval [as callAsync] (eval at create (C:\Users\COD002\OneDrive\桌面\vue-test\test\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:12064) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:12064) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I have tried update core-js and download the whole node_modulesagain.But it doesn't work.
My package.json
{
"name": "test",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"build-watch": "vue-cli-service --env.NODE_ENV=development build-watch --mode development"
},
"dependencies": {
"vue": "^3.2.13"
},
"devDependencies": {
"#babel/core": "^7.12.16",
"#babel/eslint-parser": "^7.12.16",
"#vue/cli-plugin-babel": "~5.0.0",
"#vue/cli-plugin-eslint": "~5.0.0",
"#vue/cli-service": "~5.0.0",
"core-js": "^2.6.12",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"vue-cli-plugin-chrome-extension-cli": "~1.1.4"
},
"eslintConfig": {
"root": true,
"env": {
"node": true,
"webextensions": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "#babel/eslint-parser"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
}
I have fixed this problem myself by chance. I deleted the node_modules folder again and ran npm install. It was warning me that Prototype Pollution in async, so I
followed guidance to fix it. Then the program didn't throw the error.

npm run stopped working, but vue-cli-service is after installing plugin

I'm not quite sure what happened, but I've just installed a new plugin via npm i -S vue-the-mask.
Now whenever I try running npm run serve it returns "Error: Cannot find module 'side-channel'", and logs a bunch of required stack that are already present.
But somehow.. when I run vue-cli-service serve, it works perfectly fine. Same issue when running npm run build vs vue-cli-service build.
I've tried updating npm but it's not fixed still.
Log when running npm run serve:
ERROR Error: Cannot find module 'side-channel'
Require stack:
- /Users/User1/Documents/App1/node_modules/qs/lib/stringify.js
- /Users/User1/Documents/App1/node_modules/qs/lib/index.js
- /Users/User1/Documents/App1/node_modules/express/lib/middleware/query.js
- /Users/User1/Documents/App1/node_modules/express/lib/application.js
- /Users/User1/Documents/App1/node_modules/express/lib/express.js
- /Users/User1/Documents/App1/node_modules/express/index.js
- /Users/User1/Documents/App1/node_modules/webpack-dev-server/lib/Server.js
- /Users/User1/Documents/App1/node_modules/#vue/cli-service/lib/commands/serve.js
- /Users/User1/Documents/App1/node_modules/#vue/cli-service/lib/Service.js
- /Users/User1/Documents/App1/node_modules/#vue/cli-service/bin/vue-cli-service.js
Error: Cannot find module 'side-channel'
Require stack:
- /Users/User1/Documents/App1/node_modules/qs/lib/stringify.js
- /Users/User1/Documents/App1/node_modules/qs/lib/index.js
- /Users/User1/Documents/App1/node_modules/express/lib/middleware/query.js
- /Users/User1/Documents/App1/node_modules/express/lib/application.js
- /Users/User1/Documents/App1/node_modules/express/lib/express.js
- /Users/User1/Documents/App1/node_modules/express/index.js
- /Users/User1/Documents/App1/node_modules/webpack-dev-server/lib/Server.js
- /Users/User1/Documents/App1/node_modules/#vue/cli-service/lib/commands/serve.js
- /Users/User1/Documents/App1/node_modules/#vue/cli-service/lib/Service.js
- /Users/User1/Documents/App1/node_modules/#vue/cli-service/bin/vue-cli-service.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> (/Users/User1/Documents/App1/node_modules/qs/lib/stringify.js:3:22)
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)
Content in package.json:
"name": "xxx-v1",
"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",
"v-wave": "^1.2.8",
"vue": "^3.0.0",
"vue-router": "^4.0.0-0",
"vuex": "^4.0.0-0"
},
"devDependencies": {
"#vue/cli-plugin-babel": "~4.5.0",
"#vue/cli-plugin-eslint": "~4.5.0",
"#vue/cli-plugin-router": "~4.5.0",
"#vue/cli-plugin-vuex": "~4.5.0",
"#vue/cli-service": "~4.5.0",
"#vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0",
"sass": "^1.26.5",
"sass-loader": "^8.0.2"
}
}

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

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.