$ yarn install
yarn install v1.19.1
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies cau
sed by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/5] Validating package.json...
error app#0.3.0: The engine "node" is incompatible with this module. Expected version ">=10.17.0". Got "10.15.2"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
getting the errors while installing the yarn in react js project
error app#0.3.0: The engine "node" is incompatible with this module. Expected version ">=10.17.0". Got "10.15.2"
error Found incompatible module.
Remove package-lock.json and run yarn install --ignore-engines
When working on a team, sometimes another dev installs it. One good way to avoid this happening is using package-locks-checks, which I wrote.
If you run npx package-locks-checks it will check for this kind of inconsistencies and avoid you to have issues on production environment.
Related
my ts code was working fine both locally and on the server but after I restarted the code on production I found there were errors(restarting installs package all over again with yarn install) and when I yarn install locally now it also creates same error
server/Startup.ts:119:12 - error TS2339: Property 'status' does not exist on type 'Response<any, Record<string, any>>'.
119 .status(HttpStatusCode.NOT_FOUND)
~~~~~~
Found 1640 errors.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
the typescript errors are nonsense to my eyes with the experience I have now, cause I know for sure
server/routes/savings_report.routes.ts:17:17 - error TS2339: Property 'get' does not exist on type 'Router'.
17 this.router.get(
~~~
the express router has the get property and the code has been working fine before
I honestly don't know where the issue is here, yarn? npm? or ts-node itself?
I tried to use npm to install the packages
I tried to clean cache of npm and yarn to install again
I tried to remove the lock files(yarn.lock and package-lock.json) to reinstall fresh from the package json.
I asked my colleague to clone and run the code (previously working code from main branch) and the same errors like these show up.
This may be caused by breaking changes in updated dependencies, which still comply with package.json versions
If you have an old yarn.lock, restore it and try yarn install --immutable, if not - try to install a specific older version of the broken dependency
I had the same problem with some protestware dependencies, fixed that by fixing to an older version with
// package.json
...
"dependencies": { // freesed dependency version
"event-source-polyfill": "=1.0.24",
...
},
...
"resolutions": { // forcefully freesed dependency in the whole tree
"es5-ext": "0.10.53"
}
...
I installed webpack into my react project, but the same error occurred every time when I use npm start:
The react-scripts package provided by Create React App requires a dependency:
"webpack": "4.42.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of webpack was detected higher up in the tree:
C:\react\minimoj\node_modules\webpack (version: 4.43.0)
I tried to remove package-loc.json file + all node_modules + remove webpack name from package.json and reinstall it with npm install. Also I tried same with yarn, but it didn't help. I see that in node_modules version is 4.43 and after I use npm install webpack in the file package-loc.json it shows 4.43, but at the moment when I use npm start it changed to 4.42 and error occur. In addition I also reinstall node.js but it didn't help.
create .env file and add SKIP_PREFLIGHT_CHECK=true
I had similar with a newer webpack version being installed than what react_scripts required.
To fix I deleted webpack and webpack-dev-server from my project's node_modules, went to a console outside of the project dir and ran
npm uninstall webpack
npm uninstall webpack-dev-server
Then ran
npm install
npm run build
And all was well, as my package.json was correct without change.
Since webpack is mostly focused on common js according to some websites, I just tried rollup for my react project and it proved to be much more effective as it supports es+. I would highly recommend it. I took a couple minutes to have everything setup and ready. Also, as a good practice it is better to use yarn as npm has had a lot of known issues for node app management.
I am trying to make a simple electron app built on the electron react boilerplate that queries a local instance of a Microsoft SQL server that I have. Since I want to use Windows Authentication it seems that I have to use the msnodesqlv8 package, but on install it throws a series of warnings that then lead to errors and crashes on startup.
My system environment is electron react boilerplate (which includes webpack) installed on 64-bit Windows 10, with a local running instance of a MS SQL Server 2017. I do my package management through yarn, but npm install yields the same issues. Cmd is being run as an administrator. My process versions are as follows:
chrome: "78.0.3904.130"
electron: "7.1.4"
node: "12.8.1"
v8: "7.8.279.23-electron.0"
The exact log on yarn is:
WARNING in ./node_modules/msnodesqlv8/lib/bootstrap.js 37:23-38
Critical dependency: the request of a dependency is an expression
# ./node_modules/msnodesqlv8/lib/connection.js
# ./node_modules/msnodesqlv8/lib/sql.js
# dll renderer
WARNING in ./node_modules/msnodesqlv8/lib/bootstrap.js 57:25-40
Critical dependency: the request of a dependency is an expression
# ./node_modules/msnodesqlv8/lib/connection.js
# ./node_modules/msnodesqlv8/lib/sql.js
# dll renderer
it seems to be an error in the included bootstrap library, but I have not found any way to stop it or fix it. If anyone knows how to make this driver work (or any MSSQL Windows authentication alternatives to msnodesqlv8), I would appreciate the help.
Edit
I found a tentative workaround thanks to TimelordUK/node-sqlserver-v8/pull/131, using the following steps.
install node-loader
npm install node-loader --save-dev or yarn add node-loader
add the following rule to your webpack.config.js (or webpack.config.base.js, if using electron-react-boilerplate)
{
test: /\.node$/,
use: 'node-loader'
}
install node-sql-server-v8/pull/131
If you already have the mssqlv8 package installed, remove it by running npm uninstall mssqlv8 or yarn remove mssqlv8. Then reinstall the specific pull request with npm or yarn:
npm install --save-dev TimelordUK/node-sqlserver-v8#pull/131/head
yarn add TimelordUK/node-sqlserver-v8#131/head
Copy the relevant .node binary from /node_modules/msnodesqlv8/lib/bin to the /app/bin directory.
In my case this was the sqlserverv8.node.v12.13.0.electron.v7.1.2.x64.node file. Your webpack output folder may be different, but for me it is the app folder since I am using the react boilerplate. You can find your output folder in the webpack config, ensure that it contains a bin subfolder with the proper .node binary.
Use msnodesqlv8 as usual!
When installing dependencies using yarn, one package (newrelic) gives the following error:
newrelic#5.6.2: The engine "node" is incompatible with this module. Expected version ">=6.0.0 <11.0.0". Got "11.13.0"
The only workaround to this I could find is to run
yarn install --ignore-engines
However, this would ignore engine mismatch across packages. Is there any way to ignore it only for a specific package?
There doesn't appear to be a way to provide package-specific flags on the install command.
However, you can try adding the problematic packages with the flag and followup with a normal install afterwards.
yarn add <problematic packages> --ignore-engines
yarn install
By default, unless --force is provided as a flag to yarn install, packages that already are installed will not be fetched again.
Hey guys for some reason I keep getting this error when building with sass-loader
Module build failed: Error: Missing binding C:\TFS_Local\DPOnGit\node_modules\node-sass\vendor\win32-ia32-11\binding.node
Node Sass could not find a binding for your current environment: Windows 32-bit with Node 0.10.x
Found bindings for the following environments:
- Windows 64-bit with Node.js 5.x
This usually happens because your environment has changed since running npm install.
Run npm rebuild node-sass to build the binding for your current environment.
Very frustrating as this config has worked on the same machine before without issues.
I had the same problem, rebuilding as suggested by the error message didn't work for me, but running
npm install --save sass-loader
did.