so previously, I installed Typecript on my new macbook by running this command
sudo npm install typescript -g
and I got Typescript version 4.7.4. and then I want to deploy the function using this command
firebase deploy
unfortunately, there is a warning like this
WARNING: You are currently running a version of TypeScript which is
not officially supported by #typescript-eslint/typescript-estree.
You may find that it works just fine, or you may not.
SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.1.0
YOUR TYPESCRIPT VERSION: 4.7.4
Please only submit bug reports when using the officially supported
version.
and then I downgrade to version 4.0.7, but unfortunately that warning still exist, it seems my app is still on v4.7.4 (cached ? ) I am sure I have changed the typescript version on package.json and I also check via terminal like the image below
but why my node app still have version v.4.7.4 ? not v.4.0.7 ? what should I do?
fiuhhh....after 2 days, I finally find the solution
I have to change the dependencies and also the devDependencies, especially these dependencies in the package.json
"dependencies": {
"firebase-admin": "^10.0.2",
"firebase-functions": "^3.18.0",
},
"devDependencies": {
"#typescript-eslint/eslint-plugin": "^5.12.0",
"#typescript-eslint/parser": "^5.12.0",
"eslint": "^8.9.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "^2.25.4",
"typescript": "^4.5.4" // <-- watch this version
},
the problem is ....it seems to me that these dependencies is tightly coupled. it can easily break if it doesn't match. so my solution is to create new project just to copy and paste those dependencies combination above with the latest version recommended by firebase. watch this video if you are confused how to initialize cloud function project
first, Update your firebase tools to the latest version using this command
sudo npm install -g firebase-tools
and change to your directory and init the project
cd desktop
mkdir forCopyPasteDependenciesOnly
firebase init
select cloud function and typescript. and then you copy those dependencies above and paste it on your problematic project
in my case, I also change the typescript globally using the recommended typescript version from the project package.json that you just initialize (4.5.4, not 4.0.7 or 4.7.4 in my case )
sudo npm uninstall -g typescript
sudo npm install -g typescript#4.5.4
and then, in your problematic project, delete your node-modules folder
and delete your package-lock.json. and finally run these 2 commands below
npm cache clean –force
npm install
and when you run firebase deploy you may see errors, but luckily it just error from eslint you just update, you can solve it easily.
I hope it helps
You installed typescript as globally on your system but you changed just in your package.json.
First you should type this npm uninstall -g typescript.
Then npm install -g typescript#your version.
After that you can uninstall your local tsc on your project.
This is a React web app. When I run
npm start
This error occurred
> dataflow#0.1.0 start
> react-scripts start
node:internal/modules/cjs/loader:488
throw e;
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /Users/juliantc/Desktop/ai-studio/development/frontend/node_modules/postcss-safe-parser/node_modules/postcss/package.json
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:416:9)
at packageExportsResolve (node:internal/modules/esm/resolve:669:3)
at resolveExports (node:internal/modules/cjs/loader:482:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/juliantc/Desktop/ai- studio/development/frontend/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Node.js v17.0.1
This error only occurs when I run this on this specific computer, which I do not have superuser access to. It works on other computers.
For reference, this is ./node_modules/postcss-safe-parser/node_modules/postcss/package.json
{
"name": "postcss",
"version": "8.2.6",
"description": "Tool for transforming styles with JS plugins",
"engines": {
"node": "^10 || ^12 || >=14"
},
"exports": {
".": {
"require": "./lib/postcss.js",
"import": "./lib/postcss.mjs",
"types": "./lib/postcss.d.ts"
},
"./": "./"
},
"main": "./lib/postcss.js",
"types": "./lib/postcss.d.ts",
"keywords": [
"css",
"postcss",
"rework",
"preprocessor",
"parser",
"source map",
"transform",
"manipulation",
"transpiler"
],
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
"author": "Andrey Sitnik <andrey#sitnik.ru>",
"license": "MIT",
"homepage": "https://postcss.org/",
"repository": "postcss/postcss",
"dependencies": {
"colorette": "^1.2.1",
"nanoid": "^3.1.20",
"source-map": "^0.6.1"
},
"browser": {
"./lib/terminal-highlight": false,
"colorette": false,
"fs": false
}
}
And this is what I get when I list the files in ./node_modules/postcss-safe-parser/node_modules/postcss/lib/
lgtd-lt-119-mbmt:frontend juliantc$ ls ./node_modules/postcss-safe-parser/node_modules/postcss/lib/
at-rule.d.ts css-syntax-error.d.ts input.d.ts map-generator.js postcss.d.ts processor.js rule.js tokenize.js
at-rule.js css-syntax-error.js input.js node.d.ts postcss.js result.d.ts stringifier.js warn-once.js
comment.d.ts declaration.d.ts lazy-result.d.ts node.js postcss.mjs result.js stringify.d.ts warning.d.ts
comment.js declaration.js lazy-result.js parse.d.ts previous-map.d.ts root.d.ts stringify.js warning.js
container.d.ts fromJSON.d.ts list.d.ts parse.js previous-map.js root.js symbols.js
container.js fromJSON.js list.js parser.js processor.d.ts rule.d.ts terminal-highlight.js
I am also stuck with the same problem because I installed the latest version of Node.js (v17.0.1).
Just go for node.js v14.18.1 and remove the latest version just use the stable version v14.18.1
nvm uninstall <version>
OR
nvm uninstall v17.0.1
then install the LTS one which is v14.18.1
nvm install --lts
This worked for me.
Remove node_modules folder and .lock file and re-install your packages (yarn or npm).
It worked for me with last 17.0.1 of nodejs, I can npm (or yarn) start my app again.
my working solution was with yarn:
removed /node_modules and yarn.lock file.
then reinstalled my deleted packages/file using yarn install .
it worked !!!
Roll back to Node 16.8.0 or (works for me) stable version 16.13.0:
Step 1: install n
npm install -g n
Step 2: install/set node latest stable version
sudo n stable
or set 16.8.0
sudo n 16.8.0
Note, if you can't or don't want to use sudo for n, you can set environment variables for the location, eg;
export N_PREFIX=$HOME/.n
export PATH=$N_PREFIX/bin:$PATH
FWIW, I bumped into this issue on macOS Monterey with Node 17.0.1 installed via Homebrew. Downgrading to Node 16.x worked for me.
Downgrade from Node 17.x (latest) to Node 16.x using Homebrew:
brew uninstall --ignore-dependencies node
brew install node#16
brew link node#16
removing and reinstalling lock and node modules didn't help but npm update worked for me
After removing node_modules & package-lock.json, I ran
npm audit fix --force
& updated react-scripts to the latest available version with
npm install react-scripts#latest
I also get the error when using Node.js v17.0.1 (Lates Features) - I am using macOS Catalina and homebrew.
So I want to switch Node.js v17.0.1 to Node.js (LTS) -> Node.js v16.3.1
I uninstall node using homebrew with the following command:
brew uninstall node
Then I download Node LTS from https://nodejs.org/en/ and install it.
That is work for me. Thanks :)
I had this issue with craco and postcss. What I did to solve is
npm i -D postcss#latest
export NODE_OPTIONS=--openssl-legacy-provider
npm install
You don't need to roll back to older node versions.
On node.js v18 I solved it by removing the node_modules folder and the package-lock.json file:
rm -rf node_modules package-lock.json
...then running:
npm i
npm audit fix
My next npm start worked just fine.
This problem can be occur when you are trying to work with an old react repository which is developed with a lower node.js version than v17.0.1 and you are currently using v17.0.1 or a higher node version.
Delete your node_modules folder, package-lock.json and yarn
file (if you have one).
Force clean the entire NPM cache by using following command. While executing this command, you might get a warning, just ignore it.
npm cache clean --force //WARN using --force Recommended protections disabled.
Re-Install all the dependencies.
npm install
I was receiving
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/parser' is not defined by "exports" in ...node_modules\next\node_modules\postcss\package.json
I have resolved it on node version 17.4.0 after I upgraded react, and nextjs using:
npm install react#latest react-dom#latest
npm install next#12
(https://nextjs.org/docs/upgrading)
I just did:
npm update
npm start
worked for me.
I don't get why #AnmolNoor wants you to uninstall version 17.
The proper way:
Make sure you have nvm (https://github.com/nvm-sh/nvm). If you don't, I highly recommend installing it.
Check your node --version
If the version is 17, this might be the reason for the error (as it was in my case)
Run nvm install 14. After installing is complete, it should also switch your node version to 14.
Check the version node --version just in case. If you still see 17, run nvm use 14
Your node --version should now be 14.
Note: Every time you close the current terminal tab, your default node version will return back to 17 unless you change this.
Next time you have to switch node version to 14, you don't have to install it again, just run nvm use 14
Remove node_module & package-lock.json
then
npm install
( in install if you get error as to use --force and --legacy-peer-deps the command as
`npm install --legacy-peer-deps`
)
npm start
An update to the latest version of "react-scripts" have been worked for me! Previous "react-scripts" version was 4.0.3 and I've updated to 5.0.0. Node version is 17.0.1.
If you use yarn you can:
rm -rf node_modules yarn.lock
yarn add -D react-scripts#latest
yarn build
For npm:
rm -rf node_modules package-lock.json
npm install -D react-scripts#latest
npm install
npm run build
I faced similar issue and it was due to node version v17.1.0.
I have nvm with 3 different versions of node installed. Just switched to version v14.18.1 using nvm and the issue resolved.
Uninstalling the current Node.js and installing LTS solves the problem, but if you want to keep the currently installed version, you could use nvs add lts to install the latest Node.js LTS, and activate it using nvs use node/<lts version>/<platform>. The LTS version and Platform values will be provided in the first command output.
I had the same problem 5 minutes ago, which is strange because it was working, but anyway, in my case the problem was in version 3.0 of the package "resolve-url-loader", after upgrading to version 5.0, everything has been resolved.
npm i resolve-url-loader#^5.0.0 --save-dev
If you have this package and node 17+, try to update it to the latest version, outdated versions cause problems like this.
If you hit an error in your application with Node.js 17, it’s likely
that your application or a module you’re using is attempting to use an
algorithm or key size which is no longer allowed by default with
OpenSSL 3.0. A command-line option, , has been added to revert to the
legacy provider as a temporary workaround for these tightened
restrictions.ERR_OSSL_EVP_UNSUPPORTED--openssl-legacy-provider
For details about all the features in OpenSSL 3.0 please see the
OpenSSL 3.0 release blog.
Contributed in https://github.com/nodejs/node/pull/38512,
https://github.com/nodejs/node/pull/40478
https://nodejs.org/en/blog/release/v17.0.0/#openssl-3-0
For me, I updated the Node version to the v16.17.1 and removed and reinstall packege.json, now it is fixed
Some context
Every time VS Code is released built on a new version of Node, the VS Code Arduino extension breaks until a new version is released.
Having cloned the Arduino extension git repo I uninstalled it as an extension and ran it in the debugger. This worked and now I have specific intel, if only I knew how to act on it. This is the message:
[Warn] no library available after trying files native_loader.js
undefined
Array[3]
0
"d:/vscode-arduino/out/node_modules/node-usb-native/lib/native/detector_darwin_7.1.11_x64.node"
1
"d:/vscode-arduino/out/node_modules/node-usb-native/lib/native/detector_Ubuntu14.04_7.1.11_x64.node"
2
"d:/vscode-arduino/out/node_modules/node-usb-native/lib/native/detector_win32_7.1.11_x64.node"
rejected promise not handled within 1 second: Error: The module '\\?\d:\vscode-arduino\out\node_modules\usb-detection\build\Release\detection.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 80. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
extensionHostProcess.js
stack trace: Error: The module '\\?\d:\vscode-arduino\out\node_modules\usb-detection\build\Release\detection.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 80. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
The last of these files (the Windows x64 one) is indeed present on the expected path so "no library available" doesn't mean it can't find the file. This agrees with the end of the message which reports that no suitable version can be found.
The end of this message suggests npm rebuild or npm i so I tried those to no avail.
Rummaging in package.json revealed
"scripts": {
"vscode:prepublish": "gulp build --mode=production",
"postinstall": "cd ./src/views && npm install && node ../../node_modules/node-usb-native/scripts/rebuild-serialport.js",
"test": "gulp test"
},
"extensionDependencies": [
"ms-vscode.cpptools"
],
"devDependencies": {
"#types/compare-versions": "^3.0.0",
...
"webpack": "^4.44.1"
},
"dependencies": {
...
"node-usb-native": "0.0.13",
...
}
The dependency on node-usb-native is behind the latest (0.0.15). Changing this and running npm i triggers the post-install task to rebuild-serialport.js which appears to succeed, but I get the same error at runtime.
The question
How do I resolve this?
What exactly needs rebuilding? usb-detection isn't listed in the dependencies (or the devDependencies) but if I'm not mistaken node-usb-native depends on it.
How do I go about this such that the code complaining about
versions sees the freshly minted bits?
When I try to run the project, the following message appears:
node-pre-gyp info This Node instance does not support builds for N-API
version 6
How can you fix it?
node -v
v12.14.1
npm -v
6.13.4
"#tensorflow/tfjs": "^2.3.0",
"#tensorflow/tfjs-node": "^2.3.0"
Upgrade your version of Node.js.
I just tried this with v12.15.0 and it has the same problem.
I then tried it with v12.18.3 (latest LTS) and it doesn't have the problem.
Note:
You might need to delete node_modules and do npm install again once you have installed the latest version of Node.js.
I recommend that you install nvm (node version manager) so that you can easily change between different versions of Node.js.
Get it for Linux and MacOS here: https://github.com/nvm-sh/nvm
Get it for Windows here: https://github.com/coreybutler/nvm-windows
I am pretty new to this environment still and am trying to get up to speed on node.js modules and Laravel (5.1.11) as a whole, so...
I have a fresh install of Laravel implemented by the cPanel Installitron. I'm using PHPStorm to install all of the node modules via the provided package.json:
package.json
{
"private": true,
"devDependencies": {
"gulp": "^3.8.8"
},
"dependencies": {
"laravel-elixir": "^3.0.0",
"bootstrap-sass": "^3.0.0"
}
}
The error I get when I run the install is:
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node":
HTTP error 404 Not Found
I can understand why this would happen, seeing as that is an older version of node-sass, but how do I know what newer versions are compatible with the requested version of laravel-elixir? I didn't want to just install a newer version of node-sass because digging a deeper hole would make it harder for me to find a solution to my problem. What is the fix for this?
It looks like you can fix this by installing Windows Build Tools via this command:
npm install --global --production windows-build-tools
Then delete the project's node_modules folder and re-run npm install.
Just follow this official url well doc.: https://laravel.com/docs/5.3/elixir if you get any error. I just comment and i ll be here.