ERROR: Could not find plugin "proposal-private-methods". Ensure there is an entry in ./available-plugins.js for it - npm

When trying to run yarn dev and I am getting the following error:
Error: [BABEL] C:\Users\User\OtherFolders\src\index.js: Could not find plugin "proposal-private-methods". Ensure there is an entry in ./available-plugins.js for it.
I have "#babel/plugin-proposal-private-methods": "7.8.3" as a dependency on my package.json file. Also, the #babel/plugin-proposal-private-methods folder is present in the node_modules folder.
I had tried the following to no luck:
Adding a resolution: "#babel/compat-data": "7.10.1" to the package file
I remove the node_module folder, yarn-lock, and package-lock files before attempting to run yarn install. yarn install runs without issues
I also try $ npm i #babel/plugin-proposal-private-methods
Any ideas on what the error could be or potential solutions? Thanks in advance for any help!

Kudos to the Babel Project GitHub team to help to solve the issue. The issue solution is to change the version of #babel/preset-env from 7.8.6 to 7.8.7 or higher. The response to this ticket in GitHub is in this link.

Related

nodemodule not found file or directory

When I remove some extra files in my project i found an error. It create a much of errors
in my project
Following picture is showing as
I did't have any idea to solve it help me to solve the issue.
You removed the file "CustomerList.vue" but you are importing it from another place. Just remove the import.
Delete node-modules folder.
run command npm cache clean --force.
run command npm install.
Finally install the package again with npm install your-package-name.

Bamboo build fails because webpack donesn't find node_modules

I have configured my project on angular 1.7 with webpack. In local when I run the task npm run build (launchin webpack) everything goes correctly.
But I have a plan for my CI bamboo and when a run the NPM task with npm run build I got a message, which said:
Error: Cannot find module './yargs'
I have the intuition that webpack is not able to reach the node_modules or is not in current directory.
But node_modules is installed and yargs is there after making the npm install task before.
if I run a script before the npm run build with just "ls -l" command I get:
node_modules
package-lock.json
package.json
src
webpack.config.js
So the folder is there.
Any idea where I can take a look?
I found the solution for the issue. In the Source code checkout configuration the "Force clean build" has been checked and now the build succed.
I'm not sure why, but there must have been a conflict with a previous node_modules.
The spelling of the file that you're referring is case-sensitive when building via bamboo
building locally wouldn't give you any error nor warnings in the console.
I encountered this issue with a local file (not a node_module)... Hoping this would help someone in the future;

react-native link can't find my MainApplication.java file

Every time I try to react-native link a new library, I get the same error message. Here it is for react-native-video.
rnpm-install info Linking react-native-video android dependency
rnpm-install ERR! Something went wrong while linking. Error: ENOENT: no such file or directory, open '/Users/Me/Projects/myProject/android/app/src/main/java/com/companyName/appName/MainApplication.java'
Please file an issue here: https://github.com/facebook/react-native/issues
The actual location of my MainApplication.java file is
./android/app/src/main/java/com/appName/MainApplication.java
The difference is that React Native Link is including "company name" in the path, which doesn't match my project.
How can I fix this?
I looked over some topic and found solution, you can try with:
npm install --save-dev babel-plugin-module-resolver
and then add your npm install package & react-native link again.
Good luck
I'm pretty late to the party on this, but for future reference;
TLDR: Adding another folder like so java/com/companyName/AppName/ will fix your issue.
After updating to the latest react-native I had this issue too. Your android path contains your apps ID so com.test.app path should be android/app/src/main/java/com/test/app.
Looking at your error message, its actually telling you where it's expecting the file to be;
Error: ENOENT: no such file or directory, open '/Users/Me/Projects/myProject/android/app/src/main/java/com/companyName/appName/MainApplication.java'
If you create another folder like so java/com/companyName/AppName/ you will be able to automatically link plugins.
Another way I tried and it works for me:
rm -rf node_modules && npm install
Then retry install your package:
ex:
npm install react-native-image-picker#latest --save
Then react-native link your package
react-native link react-native-image-picker
There are only two options that i am aware of to solve this problem
close all the terminals to stop the node server running on a difference terminal.
If you still have the mistake after that then try the following option
You might still have the error because you uninstall and re-install react-native without paying attention to the version that you installed which for most case will be the latest version. So double check the current version of your react-native when installing it. "\n"
so either
in your package.json you add "react-native": "^0.60.5" if the version is 0.60.5 replace "^0.60.5" by the version you are trying to run, in devDepencies and run npm install
or
run npm install react-native#0.60.5 or npm install react-native#version

Electron Atom - Module "Node-Windows" not found after compiling

After hours of searching and still not finding a usefull answer, I hope somebody could help me with following issue that I'm facing:
I inclued to my Electron APP a module called "node-windows" so I could register a script as a service to a windows machine.
I've installed it over the command
=> npm install -g node-windows
and linked it to my project path with:
=> npm link node-windows
However if I try to compile my Project with EPI with or without asar source packaging, and start up the compiled EXE, I'm getting following error from the DeveloperTools:
Uncaught Error: Cannot find module 'node-windows'
As long the project isn't compiled yet, everything works fine.
I already checked that the module is linked to the folder node_modules in the APP Directory as also in the npm folder in the AppData directory.
What could I've been missing or what could I check to get this working?
Thank you already very much for an answer
Ok here my Solution. Guess this was an absolutely noobie mistake ^^
I've forgot to include the module to the package.json file.
I did this with "npm install -g node-windows --save-dev" & "npm install -g node-windows --save".
After that it worked.

Unknown plugin specified in .babelrc, attempted to resolve relative to path

So I've started a new react-native project and copied over the .babelrc file from my previous project. I've installed the necessary plugins but I'm getting the error
Unknown plugin transform-decorators-legacy specified in .babelrc, attempted to resolve relative to "/mypath/project"
I've checked the node_modules in the path and see that the plugin was installed using yarn add. I'm also getting similar errors with my eslint plugins. Am I missing something in my project setup to have babel and eslint see the node_modules?
Is it perhaps caused by installing react-native-code-push? I think it had some errors when I installed codepush where it duplicated the react pod in the pod install - and so I removed it from the podfile. Is it trying to use a cached code-push js even though I don't have code push implemented in my react js files?
trasnform-decorators-legacy
You have a typo here.
try this :
yarn add babel-plugin-transform-decorators-legacy -g
for NPM :
npm install --save babel-plugin-transform-decorators-legacy