Error: Cannot find module 'less' with pnpm - npm

Im trying to use pnpm but get this error on the buildmachine:
Error: Cannot find module 'less'
at Function.Module._resolveFilename (module.js:339:15)
at Function.require.resolve (internal/module.js:23:19)
at resolve_engine_path (C:\BuildAgent\_work\Web\App\node_modules\.registry.npmjs.org\accord\0.26.4\node_modules\accord\lib\index.js:65:18) at Object.exports.load (C:\BuildAgent\_work\Web\App\node_modules\.registry.npmjs.org\accord\0.26.4\node_modules\accord\lib\index.js:25:19) at Object.<anonymous> (C:\BuildAgent\_work\Web\App\node_modules\.registry.npmjs.org\gulp-less\3.3.0\node_modules\gulp-less\index.js:9:29) at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
##[error]Running build failed.
##[error]Error:
##[error]System.Exception: Failed to run gulp build-release
Im trying to reslove this error but cant figure out how to get pnpm to install the module. Accorging to this issue this should be resloved already:
https://github.com/pnpm/pnpm/issues/118
Some of the package.json:
"devDependencies": {
"aurelia-bundler": "^0.3.2",
"aurelia-tools": "^0.1.0",
"babel-eslint": "^4.1.6",
"del": "^1.1.0",
"eslint": "^1.10.3",
"eslint-plugin-aurelia": "^0.3.0",
"gulp": "^3.8.10",
"gulp-babel": "^5.1.0",
"gulp-bump": "^0.1.11",
"gulp-changed": "^1.1.0",
"gulp-concat": "^2.5.2",
"gulp-cssmin": "^0.1.7",
"gulp-eslint": "^1.1.1",
"gulp-jshint": "^1.9.0",
"gulp-less": "^3.0.1",
"gulp-plumber": "^0.6.6",
"gulp-shell": "^0.4.0",
"gulp-sourcemaps": "^1.3.0",
"gulp-uglify": "^1.1.0",
Anyone had this issue and solved it?
Please let me know if im missing some info out!

You can run npm install less in terminal

Related

Eslint SyntaxError: Unexpected token =

I've encountered the following error while using eslint command in my project:
$ eslint ./src/ --max-warnings 69 --ext .js,.jsx,.ts,.tsx
Oops! Something went wrong! :(
ESLint: 7.7.0
.../node_modules/language-tags/lib/Tag.js:17
static ERR_DEPRECATED = 1;
^
SyntaxError: Unexpected token =
at new Script (vm.js:83:7)
at NativeCompileCache._moduleCompile (.../node_modules/v8-compile-cache/v8-compile-cache.js:240:18)
at Module._compile (.../node_modules/v8-compile-cache/v8-compile-cache.js:184:36)
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 (.../node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object.<anonymous> (.../node_modules/language-tags/lib/index.js:11:11)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I am using the following plugins and configs for eslint:
{
"#typescript-eslint/eslint-plugin": "4.15.2",
"#typescript-eslint/parser": "4.15.2",
"eslint": "7.7.0",
"eslint-config-airbnb": "18.2.1",
"eslint-config-airbnb-typescript": "9.0.0",
"eslint-config-prettier": "8.3.0",
"eslint-import-resolver-typescript": "2.4.0",
"eslint-plugin-cypress": "2.12.1",
"eslint-plugin-dirnames": "1.0.3",
"eslint-plugin-import": "2.23.4",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-prettier": "3.4.0",
"eslint-plugin-react": "7.24.0",
"eslint-plugin-react-hooks": "4.2.0",
"eslint-plugin-simple-import-sort": "5.0.3",
"eslint-plugin-unicorn": "18.0.1"
}
I've tried to reproduce the correct package configuration which worked fine before I started switching my project from npm to yarn v1 (this problem happened because of that). But current yarn.lock is about 25000 lines long and it is tough to compare it to package-lock.json.
I solved this problem by myself eventually and want to share the solution.
The problem lied in the eslint-plugin-jsx-a11y#6.4.1 package.
Its dependencies are listed below:
dependencies:
"#babel/runtime" "^7.11.2"
aria-query "^4.2.2"
array-includes "^3.1.1"
ast-types-flow "^0.0.7"
axe-core "^4.0.2"
axobject-query "^2.2.0"
damerau-levenshtein "^1.0.6"
emoji-regex "^9.0.0"
has "^1.0.3"
jsx-ast-utils "^3.1.0"
language-tags "^1.0.5"
As it turns out, yarn v1 resolved the dependency language-tags#^1.0.5 as language-tags#1.0.7 which caused the eslint command to stop working altogether.
language-tags#^1.0.5:
version "1.0.7"
resolved ".../npm/language-tags/-/language-tags-1.0.7.tgz#41cc248730f3f12a452c2e2efe32bc0bbce67967"
integrity ...
dependencies:
language-subtag-registry "^0.3.20"
So the solution is to either change the version of language-tags in your lock file from 1.0.7 to 1.0.5 or provide a yarn resolution where you would specify the desired package version
"resolutions": {
"language-tags": "1.0.5"
}

pod install error on react native project

When I cd ios && pod install, I keep getting this error.
I tried several things like
delete node_modules and yarn install again, yarn cache clean, pod deintegrate, etc., but no luck.
❯ pod install
error Failed to load configuration of your project.
[!] Invalid `Podfile` file: 859: unexpected token at 'Error: ENOENT: no such file or directory, lstat '/Users/user/dev/fondee-rn-webview/ios/node_modules/#bam.tech/react-native-make'
at Object.lstatSync (node:fs:1514:3)
at /Users/user/dev/fondee-rn-webview/node_modules/graceful-fs/polyfills.js:319:16
at Object.<anonymous> (/Users/user/dev/fondee-rn-webview/node_modules/#bam.tech/react-native-make/react-native.config.js:9:13)
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)
at require (node:internal/modules/cjs/helpers:102:18)
at module.exports (/Users/user/dev/fondee-rn-webview/node_modules/cosmiconfig/node_modules/import-fresh/index.js:28:9)
info Run CLI with --verbose flag for more details.
'.
# from /Users/user/dev/fondee-rn-webview/ios/Podfile:24
# -------------------------------------------
# target 'fondee' do
> config = use_native_modules!
#
# -------------------------------------------
How can I successfully install pod?
I did update all the packages (yarn upgrade --latest).
Here is my package.json:
"dependencies": {
"#notifee/react-native": "7.2.0",
"#react-native-async-storage/async-storage": "^1.17.10",
"#react-native-clipboard/clipboard": "^1.8.5",
"#react-native-firebase/app": "^16.4.6",
"#react-native-firebase/messaging": "^16.4.6",
"#types/react": "^18.0.26",
"react": "18.2.0",
"react-native": "0.70.6",
"react-native-device-info": "^10.3.0",
"react-native-permissions": "^3.6.1",
"react-native-progress": "^5.0.0",
"react-native-send-intent": "^1.3.0",
"react-native-splash-screen": "^3.3.0",
"react-native-webview": "^11.15.0"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#bam.tech/react-native-make": "^3.0.3",
"#react-native-community/eslint-config": "^3.2.0",
"#types/jest": "^29.2.4",
"#types/react-native": "^0.70.7",
"#types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.3.1",
"eslint": "^8.29.0",
"jest": "^29.3.1",
"metro-react-native-babel-preset": "^0.73.4",
"react-test-renderer": "18.2.0",
"typescript": "^4.4.4"
},
"resolutions": {
"#types/react": "^18.0.26"
},
The error is occurring because #bam.tech/react-native-make does not have pod file. Why are you using this package? The package is old and has only 20 weekly downloads.
You can follow this blog to create splash screens.

Vue packages version mismatch: vue#2.6.14 vue-server-renderer#2.7.10

I am trying to compile my app and I am getting the following error
Vue packages version mismatch: vue#2.6.14 vue-server-renderer#2.7.10
This is because the version of Nuxt I am using (which i need to use) uses vue-server-renderer#2.6.14, but I am not sure whats causing the other conflict
here are my dependencies, is there any way to find out whats causing it, or fix it?
"dependencies": {
"#nuxtjs/axios": "5.5.4",
"#nuxtjs/style-resources": "0.1.2",
"#nuxtjs/svg-sprite": "0.5.2",
"#sendgrid/mail": "6.4.0",
"body-parser": "1.19.0",
"chokidar": "3.5.2",
"clipboard": "2.0.4",
"compression": "1.7.4",
"cors": "2.8.5",
"express": "4.17.1",
"feed": "4.1.0",
"gsap": "3.1.1",
"lazysizes": "5.3.2",
"lodash": "4.17.21",
"lru-cache": "5.1.1",
"moment": "2.24.0",
"mongoose": "5.9.10",
"morgan": "1.10.0",
"nuxt": "2.15.8",
"pm2": "4.4.0",
"sanitize-html": "2.5.1",
"sitemap": "2.2.0",
"stickyfilljs": "2.1.0",
"svg4everybody": "2.1.9",
"swiper": "6.8.4",
"url-polyfill": "1.1.8",
"vue-waypoint": "3.2.2"
},
"devDependencies": {
"#babel/core": "7.18.10",
"#babel/eslint-parser": "7.18.9",
"eslint": "8.23.0",
"eslint-config-standard": "17.0.0",
"eslint-plugin-vue": "9.3.0",
"eslint-webpack-plugin": "2.7.0",
"normalize-scss": "7.0.1",
"postcss-preset-env": "6.7.0",
"sass": "1.54.7",
"sass-loader": "10.3.1",
}
Full stack trace
This may cause things to work incorrectly. Make sure to use the same
version for both.
at Object.<anonymous> (/usr/src/app/node_modules/vue-server-renderer/index.js:8:9)
at Module._compile (node:internal/modules/cjs/loader:1120:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
at Module.load (node:internal/modules/cjs/loader:998:32)
at Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1022:19)
at Hook._require.Module.require (/usr/src/app/node_modules/require-in-the-middle/index.js:101:39)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/usr/src/app/node_modules/#nuxt/vue-renderer/dist/vue-renderer.js:19:27)
at Module._compile (node:internal/modules/cjs/loader:1120:14)
I changed these 3 items and it worked
from
"#nuxtjs/axios": "5.5.4",
"#nuxtjs/style-resources": "0.1.2",
"#nuxtjs/svg-sprite": "0.5.2"
to
"#nuxtjs/axios": "5.10.2",
"#nuxtjs/style-resources": "1.0.0",
"#nuxtjs/svg-sprite": "0.4.10"
Deleted modules and package-lock file, ran npm install, then it worked

"expo start --web" suddenly failing with "Body must be a string. Received: undefined"

I have just recently started with React Native and expo.
After completing a test app in the local web/dev server, I have been able to get it to work on an Android phone over a USB connection. But now the previously working web/dev server is failing:
> expo start --web
Starting project at C:\...\testproject
Body must be a string. Received: undefined.
Error: Body must be a string. Received: undefined.
at devAssert (C:\...\testproject\node_modules\graphql\jsutils\devAssert.js:12:11)
at new Source (C:\...\testproject\node_modules\graphql\language\source.js:37:56)
at new Parser (C:\...\testproject\node_modules\graphql\language\parser.js:86:62)
at Object.parse (C:\...\testproject\node_modules\graphql\language\parser.js:30:16)
at Object.<anonymous> (C:\...\testproject\node_modules\graphql-tools\src\stitching\introspectSchema.ts:7:48)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testproject#1.0.0 dev:web: `expo start --web`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the testproject#1.0.0 dev:web script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
The expo build:web command is still working though. It exports a fully functional web app to the web-build directory.
Dependencies:
"dependencies": {
"expo": "^45.0.6",
"expo-gl": "^11.3.0",
"expo-keep-awake": "^10.1.1",
"expo-navigation-bar": "^1.2.0",
"expo-splash-screen": "~0.15.1",
"expo-status-bar": "^1.3.0",
"expo-three": "^6.1.0",
"expo-web-browser": "~10.2.1",
"react": "17.0.2",
"react-dom": "^18.2.0",
"react-native": "0.68.2",
"react-native-safe-area-context": "^4.3.1",
"react-native-screens": "^3.13.1",
"react-native-web": "^0.18.1",
"three": "^0.141.0"
},
"devDependencies": {
"#babel/core": "^7.18.5",
"#expo/webpack-config": "^0.16.24",
"#types/babel__core": "^7.1.19",
"#types/babel__template": "^7.4.1",
"#types/react": "~18.0.14",
"#types/react-native": "^0.69.0",
"#types/three": "^0.141.0",
"#typescript-eslint/eslint-plugin": "^5.29.0",
"#typescript-eslint/parser": "^5.29.0",
"eas-cli": "^0.54.1",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"expo-cli": "^5.4.11",
"expo-dev-client": "^1.0.0",
"husky": "^8.0.0",
"prettier": "^2.7.1",
"typescript": "~4.7.4"
}
Problem solved.
expo start -c -w (with -c to clear the cache) revealed the problem.
Apparently a dependency update had gone wrong; React is at 17, and React-DOM and the types are at 18. Upgrading all to 18 resulted in new/different errors, so I have now downgraded all to 17 and the dev server is working again.
for me, I had expo-cli as a dependency, as soon as I removed this, the message went away
I had expo-cli(v5.4.7) as a dev dependency. Upgrading to v6.0.6 made it work for me

Gitlab Pipeline Fails-Error: We don't support cucumber version 6

hi i have an angularJs project. We prepared E2E tests for the project. I want to integrate these tests into gitlab pipeline. The log I got from Pipeline is as follows;
npm run test
> protractor-typescript-cucumber#4.0.0 test
> protractor typeScript/config/config.js
[07:45:54] I/launcher - Running 1 instances of WebDriver
[07:45:54] I/local - Starting selenium standalone server...
[07:45:55] I/local - Selenium standalone server started at http://10.235.216.81:51027/wd/hub
[07:45:58] E/launcher - Error: Error: We don't support cucumber version 6
at Object.<anonymous> (/builds/i3uGB66D/0/cloudnesiltech/delivery/bdd/bdd-delivery-web/node_modules/protractor-cucumber-framework/lib/resultsCapturer.js:31:11)
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)
at require (node:internal/modules/cjs/helpers:94:18)
at Function.loadCustomFormatter (/builds/i3uGB66D/0/cloudnesiltech/delivery/bdd/bdd-delivery-web/node_modules/cucumber/lib/formatter/builder.js:110:29)
at Function.getConstructorByType (/builds/i3uGB66D/0/cloudnesiltech/delivery/bdd/bdd-delivery-web/node_modules/cucumber/lib/formatter/builder.js:77:33)
at Function.build (/builds/i3uGB66D/0/cloudnesiltech/delivery/bdd/bdd-delivery-web/node_modules/cucumber/lib/formatter/builder.js:38:40)
at /builds/i3uGB66D/0/cloudnesiltech/delivery/bdd/bdd-delivery-web/node_modules/cucumber/lib/cli/index.js:104:31
[07:45:58] E/launcher - Process exited with error code 100
My package.json file;
"devDependencies": {
"#cucumber/cucumber": "^7.2.1",
"#types/cucumber": "^4.0.4",
"#types/node": "^10.7.1",
"#types/selenium-webdriver": "^3.0.10",
"all-contributors-cli": "^5.4.0",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"cucumber-html-reporter": "^4.0.3",
"mkdirp": "^0.5.1",
"protractor": "^5.4.0",
"protractor-cucumber-framework": "^6.1.1",
"rimraf": "^2.6.2",
"ts-node": "^7.0.1",
"typescript": "^3.0.1"
},
"repository": "https://github.com/igniteram/protractor-cucumber-typescript",
"dependencies": {
"cucumber": "^6.0.5",
"webdriver-manager": "12.1.8"
}