Yarn --link-duplicates creates error while building - babeljs

I run yarn install --link-duplicates in order to install packages. I get the following error
NOENT: no such file or directory, lstat '/.../front/node_modules/#svgr/webpack/node_modules/#babel/core/node_modules
The node_modules doesn't exist in the specific path. If i run it without --link-duplicates it runs without any error.
This happens after upgrading from "#babel/core": "^7.2.2.", to "#babel/core": "^7.9.6",
Is there any way to link-duplicates except a specific module? I try to avoid removing the --link-duplicates, because it doudbles the size of the node_modules

Related

preventing yarn from running in wrong directory

Sometimes I run yarn (2) in the wrong directory, which can result in the download of thousands of files. Cleaning that up takes a lot of time.
Is there an easy way to prevent yarn from running in a certain directory?
I am using Windows, by the way. But an OS independent solution would be even nicer.
I found this solution:
In that directory create a subdirectory node_modules.
Remove the right to write in that subdirectory for the relevant user(s).
The result looks like this:
> yarn add cypress
yarn add v1.22.15
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error An unexpected error occurred:
"EPERM: operation not permitted, mkdir 'C:\\...\\node_modules\\ansi-escapes'".
An nothing is downloaded into that node_modules.

"Fixing missing packages and vulnerabilities in age-viewer package when installing from GitHub"

I am trying to install the age-viewer from GitHub by following these steps:
Cloning the repository
Changing directory to age-viewer
Running "npm run setup"
However, I am encountering issues with missing packages and 34 vulnerabilities (3 moderate, 22 high, 9 critical). I have attempted to resolve this by running "npm audit fix --force", but it did not work.
I am looking for a solution to fix the missing packages and vulnerabilities in the age-viewer package that I am trying to install from GitHub.
Cloning the age-viewer repository from GitHub
Changing directory to age-viewer
Running "npm run setup"
Running "npm audit fix --force" to resolve issues with missing packages and vulnerabilities
I encountered a similar error. Here is how I solved it:
Removed node_modules directory from root, frontend and backend folders.
Removed package-lock.json from root, frontend and backend folders.
Ensured node version is in range 14.16.0 - 14.21.2 (I switched to 14.16.0 using nvm)
Cd to root dir of the AGE-Viewer
npm run setup
npm run start
Hope this helps.
This error can arise due to a different reason. You can try some of the following steps to solve this error.
Try using node version 14.16.0.
If you are using WSL then make sure that the node version for your system's parent os and WSl is the same.
I had the same issue while installing, the 1st solution mentioned above worked for me [for ubuntu 22.04].
Try to use 14.16.0 version of node.
But if you are already using this version then try these steps:
npm cache clean --force
delete node_modules folder and package-lock.json file from your age-viewer root
directory.
delete node_modules folder and package-lock.json file from the frontend folder in age-viewer directory.
delete node_modules folder and package-lock.json file from the backend folder
in age-viewer directory.
npm run setup
npm run start
It works for me like this.

CMake install directory permission

I have built a project using cmake (LLVM project) and tried to install it by issuing the following command:
$ cmake3 --build . --target install
If I run it using root then there is no problem and the files will be installed under the directory /usr/local/.
My problem is when I want to install the project using normal user.
I get the following error:
CMake Error at cmake_install.cmake:36 (file):
file INSTALL cannot set permissions on "/usr/local/include/llvm"
I have changed the permission of directory /usr/local/ to 777 recursively, and their ownership to root:wheel and I added my normal user to group wheel. But I still cannot install the files into the /usr/local/ directory.
The main issue is about building project in Eclipse which fails at "Build Install" command.
chmod 777 -R / is a very scary command. I've destroyed a system once by doing that.
The philosophy I use for this is:
If I need to deploy something through my IDE to debug or test before packaging, I deploy it locally within my home directory.
I only install stuff to my system (outside of home) if it has been packaged first (*.deb, *.rpm, *.tar.gz) so that I can remove it without problems.
For me, I do this with:
cmake $src
cmake --build . --target install -- DESTDIR=stage
This will configure my project, make it, then install it locally in a folder called ./stage which resides in my build directory. I can then run my executable from ./stage/usr/bin. Note that this only works if make is your generator.
Once I've tested it and I'm happy, I package it and deploy to my system or upload to a repository:
cpack
sudo dpkg -i <package>.deb
We should use USE_SOURCE_PERMISSIONS in our install function.
Example:
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Release/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" USE_SOURCE_PERMISSIONS)

Using Sails.js with yarn

When I run sails new myapp it generates a package.json file and a /node_modules directory. The sails docs say to cd in and run npm install to get up and running.
I've recently started using yarn and would like to use it to manage the additional dependencies I add to my sails app. However, when I run yarn init (what I think creates the yarn.lock file) it looks like it wants to create my package.json again. And it errors on the entry point question, saying Cannot convert object to primitive value.
Should I just stick to vanilla npm? Can Yarn and Sails play nicely in the sandbox together and share the toys?
In fact, $ yarn init (as well as $ npm init) will just initialize your package.json file by asking a few questions.
Here you don't need to regenerate your package.json but just install your node modules and generate a yarn.lock file to lock your modules versions. You can do this by using $ yarn install or just $ yarn.
You can skip $ yarn init as it does the exact same thing as $ npm init. $ yarn install actually creates the yarn.lock file. Unlike npm, yarn actually respects the engines property in a package.json file. If you run into this you can use $ yarn install --ignore-engines.

Ember-CLI error on changing a CSS file

I'm trying out Ember-CLI, and have encountered my first obscure problem (there were others, but… they're fixed). On trying to save a change in the app.css file, this happens:
file changed styles/app.css
EEXIST, file already exists '/Users/admin/projects/saves/tmp/caching-writer-dest-dir_fjlhTg.tmp'
Error: EEXIST, file already exists '/Users/admin/projects/saves/tmp/caching-writer-dest-dir_fjlhTg.tmp'
at Error (native)
at Object.fs.symlinkSync (fs.js:852:18)
at symlink (/Users/admin/projects/saves/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:82:14)
at Function.symlinkOrCopySync (/Users/admin/projects/saves/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:58:5)
at /Users/admin/projects/saves/node_modules/ember-cli/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/index.js:103:21
at lib$rsvp$$internal$$tryCatch (/Users/admin/projects/saves/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:489:16)
at lib$rsvp$$internal$$invokeCallback (/Users/admin/projects/saves/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:501:17)
at lib$rsvp$$internal$$publish (/Users/admin/projects/saves/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:472:11)
at lib$rsvp$asap$$flush (/Users/admin/projects/saves/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:1290:9)
at process._tickCallback (node.js:355:11)
The closest match I can find is this ember-cli issue.
Update and fix:
I tried the following:
rm -rf node_modules tmp dist && npm cache clean
ember install
But the issue persisted (after also trying the add rimraf to dependencies and doing npm install rimraf, now removed again).
The actual solution
Then it occurred to me that I needed to npm update ember-cli, then the above commands again, after which all is working now :-)
Update: As per raytiley's comments, the issue is not with rimraf, and the offender (broccoli-caching-writer) should be fixed soon. Therefore, at this time, Step 1 should not be necessary if you're experiencing this problem now.
See the comments in the Github Issue
This looks like a recent issue with dependencies, specifically rimraf. Currently, users are having success with this solution:
First, add this to your package.json file: (Not needed anymore)
"dependencies": {
"rimraf": "2.2.8"
}
Secondly, type this into the command line to re-install your node items
rm -rf node_modules tmp dist && npm cache clean
ember install
Hope that helps!