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
22
votes
3 answers

avoid unstable releases of mongoose in npm / package.json

How can I avoid installing unstable releases of mongoose with npm? After running npm update, I get the following warning in my node app: # !!! MONGOOSE WARNING !!! # # This is an UNSTABLE release of Mongoose. # Unstable releases are available…
Jorre
  • 17,273
  • 32
  • 100
  • 145
22
votes
2 answers

npm + Mocha --watch (not accurately watching files)

I'm using Mocha with npm, and doing an "npm test" to start up mocha. It has the --watch enabled in the mocha.opts, but for some reason it's not accurately watching. When I make a change to my test file, and then save it, whether I put in a faulty…
Mr Mikkél
  • 2,577
  • 4
  • 34
  • 52
22
votes
2 answers

How do I configure NPM to Trust the firewall issuer for HTTPS proxying?

I am attempting to use NPM in an environment behind a corporate firewall. Said firewall intercepts all https traffic and signs it with its' own CA... Is there a way to "trust" this CA so that NPM can actually work?
Tracker1
  • 19,103
  • 12
  • 80
  • 106
22
votes
3 answers

How can I remove a tag from npm?

I've published a grunt plugin to npm that's been tracking the grunt 0.4 RCs by using the master tag. I've been publishing with: npm publish --tag master Now that grunt 0.4 final has been released, I've re-published my plugin as latest via: npm…
Dan Gebhardt
  • 3,251
  • 1
  • 18
  • 15
22
votes
5 answers

package.json generation / npm unused packages

I'm introducing unit testing in my project and for this, I need to make myself a package.json file. First question is, which unit testing suite are you using? I'm looking forward mocha which seem to be pretty much standard for Node.js…
Tommy B.
  • 3,591
  • 14
  • 61
  • 105
21
votes
3 answers

Can't Resolve "encoding" Module Error While Using Nextjs-13 + Supabase

I'm trying to use Supabase for inserting/collecting data from my form. But when I compile I got encoding module is not found error. I already tried cache cleaning and re-installing npm modules. They didn't work either. Project…
Poyraz HANCILAR
  • 409
  • 1
  • 4
  • 12
21
votes
4 answers

npm login not allowing login to github

When I try to run the following in the terminal it should ask me for username and password but nothing comes up other than the error bellow. npm login --registry=https://npm.pkg.github.com --scope=@Psychedelic npm notice Log in on…
StackGod
  • 221
  • 1
  • 2
  • 4
21
votes
1 answer

What do "idealTree" and "reify" mean in the context of npm?

When creating a react app via "npx create-react-app [app_name]" I noticed the console log something like [#############] idealTree:[package-name]... and then the same thing with "reify" instead of "idealTree". When I search what these terms mean I…
21
votes
4 answers

how to solve this npm glob-parent problem

glob-parent <5.1.2 Severity: moderate Regular expression denial of service - https://npmjs.com/advisories/1751 fix available via `npm audit fix` node_modules/watchpack-chokidar2/node_modules/glob-parent chokidar 1.0.0-rc1 - 2.1.8 Depends on…
Edward
  • 211
  • 1
  • 2
  • 5
21
votes
10 answers

Cannot create a React app with create-react-app

I am facing a problem with creating a new React app using CRA when I run the following command npx create-react-app my-app. I tried to clear npm cache with this command npm cache clean --force I also tried this command npm -g uninstall…
Oussama Bouchikhi
  • 527
  • 1
  • 7
  • 22
21
votes
5 answers

Parcel JS: tree.render is not a function

Whenever I try to run production build command npm run build or npx parcel build index.html, I get this error. I have a simple html and css project, no react, no 3rd party library Why could this be happening? I have tried parcel versions 1.12.3,…
Karanveer Singh
  • 961
  • 12
  • 27
21
votes
6 answers

Is there any Yarn equivalent of npx preact create?

I am trying to run the preact create command using Yarn. It's simple to run preact create ..... ..... or npx preact create ... ..... It works fine and both of the commands use npm. But I am trying to run the command using Yarn. I have tried the…
user12987437
21
votes
3 answers

Npm Install is Failing (Could not resolve dependency)

When i try to do npm install i get the following: npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: foliosure@1.0.1 npm ERR! Found: zone.js@0.8.29 npm ERR! node_modules/zone.js npm ERR! …
Ananya Rao
  • 233
  • 1
  • 2
  • 5
21
votes
10 answers

yarn command not found after installing via npm

As per the yarn installation for yarn v2, they want you to install using npm install -g yarn. So I ran sudo npm install -g yarn on Ubuntu 20.04. But after I do that, it says command not found. ❯ sudo npm install -g yarn > yarn@1.22.10 preinstall…
cclloyd
  • 8,171
  • 16
  • 57
  • 104
21
votes
4 answers

Could not determine the dependencies of task ':app:mergeDebugAssets'

When I run react-native run-android on my project,I get an build error of gradle. I already uninstalled react-native-ftp with npm uninstall --save react-native-ftp, removed that dependency of node_modules, clear ./gradle cached files. But the error…
Leonardo Torres
  • 385
  • 1
  • 2
  • 11