Questions tagged [npm]

npm is the package manager shipped with Node.js. It can be used to install and publish CommonJS and ECMAScript modules, jQuery plugins, reusable JavaScript code (libraries), JavaScript-based CLI programs, and more.

npm is the package manager shipped with .

npm can be used to install and publish and ECMAScript modules as well as JavaScript-based CLI programs. See the npm homepage for more information.

npm has the ability to install packages to a local directory or globally with the -g flag. Global packages are generally CLI programs.

npm packages manage dependencies and pass information to npm through the file. It contains entries for package name, version, git, dependencies, and other information. The official documentation can be found here.

npm uses the system. This system promote three version stages as well as suffixes. For example, v1.2.3-alpha. npm supports modifiers such as asterisks and greater/less than signs when specifying dependencies. More information can be found here and here.

As of April 14, 2015 npm also supports private modules that can be defined and used only by users who you specify. More about private modules here.

npm comes bundled with the installation of NodeJS, so there is no need for a separate install.

To search for modules:

Documentation Links:

Useful links:

49337 questions
23
votes
3 answers

How to npm config save into project .npmrc file?

I am hoping to run npm config to set values in a project's .npmrc file. Docs dont seem to say how to specify a file to save the values into. Looking for something like npm config --file /path/to/repo/.npmrc set key value Trying to use it for a…
Mike Graf
  • 5,077
  • 4
  • 45
  • 58
23
votes
14 answers

How to fix EACCES issues with npm install

Some of my node modules get installed but there are always these sort of issues on this particular linux mint machine npm install npm ERR! Error: EACCES, open '/home/me/.npm/semver/3.0.1/package/package.json' npm ERR! { [Error: EACCES, open…
FutuToad
  • 2,750
  • 5
  • 36
  • 63
23
votes
5 answers

Can we configure multer to not store files locally and only for using req.files.image.path?

My application's need is as follows: I upload the image to Cloudinary and store the url of image in my mongodb database. To upload the image to cloudinary, I needed to give the file path, and for that, I am using multer.I use the…
Aravind
  • 3,169
  • 3
  • 23
  • 37
23
votes
5 answers

Cannot install phantomjs -- Is it a bitbucket issue?

phantomjs fails to install. Does the error indicate that bitbucket has a problem? $ sudo npm install -g phantomjs ... > phantomjs@1.9.7-6 install /usr/lib/node_modules/phantomjs > node install.js Looks like an `npm install -g`; unable to check for…
Philipp Claßen
  • 41,306
  • 31
  • 146
  • 239
23
votes
1 answer

When use npm cache and why?

When do I have to use npm cache clean ? And, why after using npm cache clean do I get info trying ? info trying registry request attempt 1 at 09:54:07 http GET https://registry.npmjs.org/delayed-stream/latest http 304…
Twinsen
  • 863
  • 1
  • 12
  • 23
22
votes
5 answers

npm run dev not working with vite laravel 9

users-iMac-2:backend NEHAL$ npm run dev > dev > vite file:///Users/user/Desktop/backend/node_modules/vite/bin/vite.js:7 await import('source-map-support').then((r) => r.default.install()) ^^^^^ SyntaxError: Unexpected reserved word at…
Nehal Ahmed Khan
  • 221
  • 1
  • 2
  • 4
22
votes
5 answers

Error: Unable to deserialize cloned data due to invalid or unsupported version

I use parcel to deploy my web projects and on one occasion I got this error below while trying to deploy the page. I tried several solutions I saw online but none worked for me, I didn't even understand some. Error: Unable to deserialize cloned data…
David.E
  • 511
  • 2
  • 4
  • 13
22
votes
4 answers

How do I fix "the requested module does not provide an export named 'default'"?

I'm developing app using JS and Vue.js and get error on line: import Vue from 'vue' I'm getting this: Uncaught SyntaxError: The requested module '/node_modules/.vite/vue.js?v=6dba2ea6' does not provide an export named 'default' I googled that…
Zixel
  • 251
  • 1
  • 2
  • 7
22
votes
3 answers

What is the difference between installing eslint as extension and installing as npm package?

I have been following various blogs and videos on setting up and configuring eslint and prettier for vscode and development. But every article fails to explain why do we need to separately install eslint as an npm package and vs code extension? what…
22
votes
13 answers

(EACCES: permission denied, mkdir '/usr/app/node_modules/.cache) How can I create a docker-compose file to make node_modules a non-root folder?

I'm trying to dockerize a simple create-react-app project. (Is the initial project after running npx create-react-app test, no files were changed). The problem seems to be that in newer versions of React, they moved the annoying .eslintcache from…
22
votes
9 answers

npm install freezes and shows idealTree:chatting: sill idealTree buildDeps

npm freezes when I am installing anything. Even after deleting package-lock.json nothing changed. Here is a similar question. Can anyone tell how can I solve this problem??
iabhishek15
  • 343
  • 1
  • 2
  • 9
22
votes
4 answers

How do I avoid unused setState functions? Can React useState be created without a setter?

I'm currently reducing / removing npm warnings on a React site. A large number of these warnings are caused by the setState function as seen below, being 'unused'. const [state, setState] = useState('some state'); Which of the following would be a…
Thomas Fox
  • 521
  • 2
  • 5
  • 16
22
votes
1 answer

npm install locally

In the past when I installed packages using npm(>=1.0) they would be installed locally, but not anymore. My setup: First I use nvm to install node.js. My operating System: alfred@alfred-laptop:~/node/so/6513101$ cat /etc/lsb-release…
Alfred
  • 60,935
  • 33
  • 147
  • 186
22
votes
2 answers

What is the meaning of npm init -y

Please I would love to know the meaning of the flag -y. I noticed it is used in setting up an npm project, but what exactly does it mean? npm init -y
George Foreman
  • 349
  • 1
  • 2
  • 6
22
votes
2 answers

when running yarn install, what does it mean when a module doesn't provide another?

when i run yarn on my react app that uses firebase, i will get several warnings like... @firebase/auth@npm:0.14.5 [c52f6] doesn't provide @firebase/app-types@0.x requested by @firebase/auth-types@npm:0.10.0 myapp@workspace:. doesn't provide…
brewster
  • 4,342
  • 6
  • 45
  • 67