I have a asp.net mvc 5 project that utilizes npm for package management.
I include node_modules directory in output and publish my project.
I then upload my project on a plesk host.
The file(s) in the Script directory load successfully, however files that are in the node_modules directory do not load.
When I rename the node_modules directory to Modules it fixes the problem. However, this is not my answer.
Where is problem? plesk does not find node_modules?
Is there some permission policy in plesk that may be causing this issue?
Why do you want to pack the node_modules? Is it not supposed to be installed by npm based on your package.json dependencies when your package is being installed or brought in as a dependency by other packages ¯_(ツ)_/¯
On a side note, even if you want to pack node_modules, is there an .npmignore or a .gitignore having a node_modules entry in it?
Related
I have two workspaces in my mono repo workspace-a and workspace-b. One depends on jest version 26 the other on 29. When I do yarn install it will install jest-26 in the root node_modules and the other one in node_modules of workspace-b.
It will then symlink the jest script in workspace-b/.bin/jest to the older jest version in the root node_modules.
So when I run yarn workspace workspace-b jest it will invoke jest-26 even though the dependency is states as 29 and it actually installed the correct version in the corresponding node_modules directory.
To me this behavior seems odd.
I could fix it and manually link it to the right version but I wonder if I did anything wrong in the setup or if this is the default behavior.
Here is a small repository to reproduce the behavior:
https://github.com/timbicker/yarn-workspace-bug/tree/main
We have a service inside a monorepo project, we want to install only that service.
We are able to install the node_modules inside that service folde (rather than at the root folder) when adding the following to package.json:
"installConfig": {
"hoistingLimits": "workspaces"
}
That's great, but some of the dependencies are links to other local packages in the repo.
Is there a way to force yarn to 'deep copy' the dependencies in the node_modules folder?
As I am implementing release automation of React JS project using Jenkins, it is required to download node_modules for a project only once and update successively. It doesn't mean one node_ modules for all projects. But one-time install for one project.
For example, Let's consider a project LoginReactApp.
I have to maintain a workspace like D:/jenkins/workspace/LoginReactApp.
So, I have to check out the source under D:/jenkins/workspace/LoginReactApp/LoginReactApp
and based on the package.json file, I need to download it under D:/jenkins/workspace/LoginReactApp/.
After the release process, the LoginReactApp project source will be deleted under D:/jenkins/workspace/LoginReactApp/ and the node_modules folder will not be deleted.
So, next time it is enough to check out only LoginReactApp project source D:/jenkins/workspace/LoginReactApp/ and it refers to already installed node_modules.
I have tried in command prompt below.
D:/jenkins/workspace/LoginReactApp/LoginReactApp>npm install
--production --f --prefix D:/jenkins/workspace/LoginReactApp/
Is it right? For next time it behaves differently.
How to install node_modules only one time for one React JS project?
When I install the following package from this git url, it creates a directory /flyLabel.js
bower install https://github.com/space150/flyLabel.js.git
The fact the directory has a dot in its name is causing issues elsewhere when I am trying to include it.
Question
Is there a way to change the name of the directory Bower is going to create when it installs the package?
I used yeoman to scaffold an angular app and I'm trying to figure out how to use the existing minified file version of the lib in the bower_components folder rather than minifying it in my build process.
Is it possible?
You can use bower-installer which is a node package to control which files to be copied to your lib folder from the downloaded distribution package folder.
https://www.npmjs.com/package/bower-installer
I followed below steps to select which files to be copied to my lib folder
1) Install bower-installer
npm install -g bower-installer
2) Edit bower.json configuration file and specify path
3) Run bower-installer from terminal