- May 2024
-
docs.npmjs.com docs.npmjs.com
-
Important for installing npm -g whatever
mkdir ~/.npm-global
npm config set-prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
(Basically add to the path)
source ~/.bashrc
-
- Mar 2024
- Aug 2023
-
stackoverflow.com stackoverflow.com
-
If you want to mimic a more production like situation you might use this workflow: Create a package of your submodule locally: cd /path/to/your/module npm pack This will create a .tgz file of your package in /path/to/your/module Install the local package of the submodule in your application: cd /path/to/your/application npm install /path/to/your/module/<YourModule>-<YourModulesVersion>.tgz
-
- Jul 2023
-
docs.npmjs.com docs.npmjs.com
Tags
Annotators
URL
-
-
blog.scottlogic.com blog.scottlogic.com
-
stackoverflow.com stackoverflow.com
-
www.sencha.com www.sencha.com
Tags
Annotators
URL
-
- Jun 2023
-
blog.domenic.me blog.domenic.me
Tags
Annotators
URL
-
-
betterprogramming.pub betterprogramming.pub
- Mar 2023
-
docs.npmjs.com docs.npmjs.com
-
- Feb 2023
-
suspense.vercel.app suspense.vercel.app
-
suspense.vercel.app suspense.vercel.app
Tags
Annotators
URL
-
- Nov 2022
-
Tags
Annotators
URL
-
- Jun 2022
-
fosstodon.org fosstodon.org
-
I have one Gatsby site left that I haven't touched in years, I doubt it will get past npm install.
-
- May 2022
-
news.ycombinator.com news.ycombinator.com
-
I develop in Node and Sveltekit regularly and the chances that on any given day my flow might be crushed by random madness is unacceptably high.
Tags
Annotators
URL
-
-
news.ycombinator.com news.ycombinator.com
-
every time i run npm install i am prepared to embark on a bunch of side missions.
-
-
news.ycombinator.com news.ycombinator.com
-
Not only this. Try to change the app two years later. Dependencies gone, wrong NPM version, Webpack config depricated and what not.That's why I like to use vanilla JS as much as possible. It will be maintainable years later.
-
- Apr 2022
-
books.openedition.org books.openedition.org
-
corriger les effets pervers de la trop grande tendance du NPM à parcelliser l’action administrative
-
- Jan 2022
-
-
{ "@context": { "doap": "http://usefulinc.com/ns/doap#", "url": "@id", "name": "doap:name", "description": "doap:description", "author": "doap:maintainter", "license": "doap:license", // can we map values to https://spdx.org/licenses/ ? ... }, "homepage": {"@id": "doap:homepage", "@type": "@id"} }
-
-
maxleiter.com maxleiter.com
-
[...] In short, pinning dependencies means the exact version specified will be installed, rather than a dependency matching the range criteria. Here's an example:
{ "dependencies": { "react": "17.0.2", // installs react@17.0.2 exactly. I recommend this. "react": "^17.0.2", // installs the latest minor version after .0 (so 17.*.*) "react": "~17.0.2" // installs the latest patch after .2 (so 17.0.*) } }
To automatically accomplish this in your projects, you can add
save-exact=true
to a.npmrc
file, or use--save-exact
when adding the dependency via npm (or--exact
via yarn).
-
- Jun 2021
-
ruanmartinelli.com ruanmartinelli.com
-
Other package managers such as Yarn and pnmp already ship with Workspaces for quite a while now.
-
-
digitalnow878391108.wordpress.com digitalnow878391108.wordpress.com
-
Why is it big news? Because the main advantage of npm over other package managers like yarn or pnpm is that it comes bundled with NodeJS.
-
-
stackoverflow.com stackoverflow.com
-
-
A really good question. Sad to realise that there is no feature equivalent for package.json to what we have in Gemfiles.
-
-
docs.npmjs.com docs.npmjs.com
-
npm install <folder>: Install the package in the directory as a symlink in the current project. Its dependencies will be installed before it's linked. If <folder> sits inside the root of your project, its dependencies may be hoisted to the top-level node_modules as they would for other types of dependencies.
-
-
stackoverflow.com stackoverflow.com
-
The local package will be copied to the prefix (./node-modules).
Yay for linking to relevant PR!
-
-
-
www.viget.com www.viget.com
-
-
The answer for me is @whitecolor's yalc.
-
But this solution has technical complications, and the npm and the yarn implimentations give people trouble (as of this writing there are about 40 open npm link issues and over 150 open yarn link issues). If you have tried to use symlinked dependencies while developing a package you've probably run into into a stumbling block, whether simply an unexpected unlink behavior, trouble with peer dependencies, or something bigger.
-
-
github.com github.com
- May 2021
-
prettier.io prettier.io
-
What is that npx thing? npx ships with npm and lets you run locally installed tools. We’ll leave off the npx part for brevity throughout the rest of this file! Note: If you forget to install Prettier first, npx will temporarily download the latest version. That’s not a good idea when using Prettier, because we change how code is formatted in each release! It’s important to have a locked down version of Prettier in your package.json. And it’s faster, too.
-
-
docs.npmjs.com docs.npmjs.com
Tags
Annotators
URL
-
-
github.com github.com
- Mar 2021
-
www.chevtek.io www.chevtek.io
-
You might get the impression after reading David's article above that this trend arose from lazy developers who "forgot how to program", but the reality is that the tiny-module ecosystem on NPM was the intention from the beginning
-
- Feb 2021
-
github.com github.com
Tags
Annotators
URL
-
- Jan 2021
-
www.npmjs.com www.npmjs.com
- Dec 2020
-
github.com github.com
-
Does anyone know how to make npm use a specific fork containing a bug fix while waiting for maintainer to merge a pull request? I was just going to point my package.json to this fork, like this: "svelte-material-ui": "https://github.com/vtpatrickeddy/svelte-material-ui.git#patch-1", but that doesn't work because the repo is a monorepo. And there doesn't appear to be a way to specify a subdirectory inside it, like: "@smui/textfield": "https://github.com/vtpatrickeddy/svelte-material-ui.git/packages/textarea#patch-1",
-
-
-
-
Familiar npm inspired dependency management.
Tags
Annotators
URL
-
-
github.com github.com
-
esy is like npm for native code
-
- Oct 2020
-
stackoverflow.com stackoverflow.com
-
sveltesociety.dev sveltesociety.dev
-
Doesn't handle:
- blur/touched
-
-
github.com github.com
-
Use a node-style require() to organize your browser code and load modules installed by npm.
-
-
github.com github.com
-
For those of you trying to get this to work using npm, "resolutions" only work in yarn. You need npm-force-resolutions to use it with npm.
Tags
Annotators
URL
-
- Sep 2020
-
github.com github.com
-
I pushed the build files & tested it in my environment so this should work as is.
-
I pushed a hotfix, based on v3.6.3 proposed by #2086 (comment) In package.json, under devDependencies, use: "svelte": "btakita/svelte#svelte-gh-2086-hotfix"
-
-
github.com github.com
-
But they also added
"postinstall": "npm run build" in https://github.com/sveltejs/svelte/commit/fbbccf50442e5b7a26b05a0fc575050407523244 so I don't know why both would be needed.
-
-
stackoverflow.com stackoverflow.com
-
From npm@5.2.0, npm ships with npx package which lets you run commands from a local node_modules/.bin or from a central cache.
-
By default, npx will check whether <command> exists in $PATH, or in the local project binaries, and execute that. Calling npx <command> when <command> isn't already in your $PATH will automatically install a package with that name from the NPM registry for you, and invoke it. When it's done, the installed package won’t be anywhere in your globals, so you won’t have to worry about pollution in the long-term. You can prevent this behaviour by providing --no-install option.
-
-
github.com github.com
-
www.npmjs.com www.npmjs.comcode-red1
-
-
svelte.dev svelte.dev
-
medium.com medium.com
-
Something to be aware of when you’re using any bundler: there’s very little consistency when it comes to how modules are packaged in NPM. It’s incredibly frustrating, especially considering many of us write modules these days using ESM. Here’s some various problems that come up:
-
-
engineering.mixmax.com engineering.mixmax.com
-
But this is only a halfway decent way to clarify that this is an external dependency, because the only way to resolve a peer dependency warning is to install react from npm—there's no way to notify npm that you resolve the dependency to a browser global. So peer dependencies should be avoided in favor of external declarations. Then Rollup will take care of warning about "unresolved dependencies", even if external declarations can't express a particular version range with which your library is compatible like peer dependencies can.
Interesting. Didn't realize. From my perspective, I usually do install packages via npm, so wouldn't have known about this problem.
npm and rollup both try to solve this problem but in different ways that apparently conflict? So if a lib author lists peerDependencies then it can cause problems for those getting lib via browser (CDN)? How come so many libs use it then? How come I've never heard of this problem before?
-
-
codedaily.io codedaily.io
-
We must always return at least some validation rule. So first off if value !== undefined then we'll return our previous validation schema. If it is undefined then we'll use the yup.mixed().notRequired() which will just inform yup that nothing is required at the optionalObject level. optionalObject: yup.lazy(value => { if (value !== undefined) { return yup.object().shape({ otherData: yup.string().required(), }); } return yup.mixed().notRequired(); }),
-
-
github.com github.com
-
passing the context into validateSync()
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
Yup.ref('value')
-
-
-
github.com github.com
-
For everyone else, npm run build will bundle your component's source code into a plain JavaScript module (dist/index.mjs) and a UMD script (dist/index.js). This will happen automatically when you publish your component to npm, courtesy of the prepublishOnly hook in package.json.
-
-
github.com github.com
-
-
For a non-monorepo package you can simply point directly to the Github repo. This case is similar, but you want to scope it just to a single package within the repo. For those that make monorepos they don't necessarily need this feature. It's for those that use projects that use monorepos. Telling them to not organize their projects into monorepos doesn't help people who make use of these projects.
-
If npm installs a git repo, it assumes that the git repo is the package. I don't really know how we could specify a sub-path easily, since all parts of the git url are already used for other things.
-
-
-
This is more a rhetoric question as this seems to be quite hard ;-) There is a long discussion about installing a subfolder of a repository and monorepos in general at the NPM Github issues (yarn misses this feature, too). The thing is that this makes it quite hard to report issues of your project as one can't test the current master easily. Do you recommend a way how to use the latest Github version?
-
- Apr 2020
-
docs.npmjs.com docs.npmjs.com
-
CLI documentation > CLI commands
-
-
blog.appsignal.com blog.appsignal.com
-
200 megabytes is not that bad. I’ve seen it rise above 700 MB easily.
200M已经不算算,升到700M都很容易。
-
- Dec 2019
-
www.freecodecamp.org www.freecodecamp.org
-
scripts are plenty powerful and often easier to live with.
-
-
help.github.com help.github.com
-
GitHub Packages uses the native package tooling commands you're already familiar with to publish and install package versions.
Looks like GitHub Packages acts as a wrapper to these clients, acting on your behalf so you don't have to use the CLI yourself.
-
-
debuggable.com debuggable.com
-
The url also contains an optional refspec (#v0.0.1) that tells npm which branch, commit, or in this case tag you want to have checked out.
-
-
github.com github.com
-
"neutrino-patch": "git+https://github.com/davidje13/neutrino-patch#semver:^1.0.1"
-
-
github.com github.com
-
npm install --save git+https://github.com/davidje13/neutrino-patch#semver:^1.0.1
-
-
stackoverflow.com stackoverflow.com
-
But what you absolutely should do is test your NPM package in its published format. Create some smoke tests that reside in the actual codebase, but are not part of the test suite.
-
-
-
npm-run-all is a CLI tool to run multiple npm-scripts in parallel or sequentially
-
- Nov 2019
-
code.visualstudio.com code.visualstudio.com
-
Option to run NPM scripts for a folder#
Tags
Annotators
URL
-
-
github.com github.com
Tags
Annotators
URL
-
- Oct 2019
-
github.com github.com
-
github.com github.com
-
github.com github.com
Tags
Annotators
URL
-
-
github.com github.com
-
github.com github.com
Tags
Annotators
URL
-
-
github.com github.com
Tags
Annotators
URL
-
-
iulian-radu-at.github.io iulian-radu-at.github.io
-
www.npmjs.com www.npmjs.comclsx1
-
-
bundlephobia.com bundlephobia.com
Tags
Annotators
URL
-
-
teamwertarbyte.github.io teamwertarbyte.github.io
-
mui.wertarbyte.com mui.wertarbyte.com
Tags
Annotators
URL
-
-
react-select.com react-select.com
-
Popout
-
-
github.com github.com
-
setState({isOpen: true}
-
-
github.com github.com
-
maslianok.github.io maslianok.github.io
-
www.npmjs.com www.npmjs.com
Tags
Annotators
URL
-
-
github.com github.com
Tags
Annotators
URL
-
- Sep 2019
-
github.com github.com
-
catamphetamine.github.io catamphetamine.github.io
-
advancedweb.hu advancedweb.hu
-
-
www.npmjs.com www.npmjs.com
-
github.com github.com
-
libphonenumber
-
-
www.npmjs.com www.npmjs.comminimist1
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
NPM was not and is still not designed to specifically be a node package manager. Yes it has a lot of useful features supporting node.js (some like node_modules is even hardcoded in node.js) but it actually doesn't care what language your software is written in. It is a package manager for your OS, just like apt and yum (or brew for you Mac users).
-
This is because it's not a node-specific package manager so what it installs could be a Python script or a shell script or a binary executable written in assembly.
-
- Aug 2019
-
stackoverflow.com stackoverflow.com
-
I found adding a "prepare": "npm run build" to scripts fixed all my problems.
-
Update the package.json in your forked repo to add a postinstall element to scripts. In here, run whatever you need to get the compiled output (Preferred).
-
-
-
instead of prepublish, you'll need to use prepare, but this is otherwise as you'd expect.
-
-
-
docs.npmjs.com docs.npmjs.com
-
prepare: Run both BEFORE the package is packed and published, on local npm install without any arguments, and when installing git dependencies
-
-
stackoverflow.com stackoverflow.com
-
This is because it's not bundled at all, while the package expects an prebuilt version existing in dist.
-
-
npm.community npm.community
Tags
Annotators
URL
-
-
www.npmjs.com www.npmjs.comchalk1
-
medium.com medium.com
-
stackoverflow.com stackoverflow.com
-
-
With now more than 3000 modules, there are huge gaps in the quality of things you find in the npm registry. But more often than not, it's easy to find a module that is really close to what you need, except if it wasn't for that one bug or missing feature.
-
-
github.com github.com
- Apr 2019
-
iamturns.com iamturns.com
-
- Nov 2018
-
nodejs.org nodejs.org
-
As a package manager, a large part of npm's job when installing your dependencies is managing their versions. But its usual model, with a "dependencies" hash in package.json, clearly falls down for plugins. Most plugins never actually depend on their host package, i.e. grunt plugins never do require("grunt"), so even if plugins did put down their host package as a dependency, the downloaded copy would never be used. So we'd be back to square one, with your application possibly plugging in the plugin to a host package that it's incompatible with.
in other words, a peer dependency enables a kind of reverse dependency. so a plugin to appA can this way 'require' that appA would be of a specific version, not as its own dependency but rather as a neighbour or parent package.
Tags
Annotators
URL
-
-
scotch.io scotch.io
Tags
Annotators
URL
-
- Oct 2018
-
medium.com medium.com
-
-
fragments.linkedsoftwaredependencies.org fragments.linkedsoftwaredependencies.org
Tags
Annotators
URL
-
- Aug 2018
- May 2018
-
artillery.io artillery.io
-
- Jul 2017
-
code.facebook.com code.facebook.com
-
The npm client installs dependencies into the node_modules directory non-deterministically. This means that based on the order dependencies are installed, the structure of a node_modules directory could be different from one person to another. These differences can cause “works on my machine” bugs that take a long time to hunt down.
This is why you should version control your package-lock.json.
-
- Jun 2017
-
magalhini.github.io magalhini.github.io
-
npm start
If you've followed the tutorial thusfar you will note that there is no 'start' script.
npm run dev
should work here!
-
- Dec 2015
-
developer.atlassian.com developer.atlassian.com
-
We shouldn't be expected to get things right the first time, but we need a platform that lets us get it wrong first, and then iterate towards perfection.
-
I highly recommend giving it a read.
Ditto, this is a very well constructed argument in favor of small modules.
Unfortunately however, the current tendency to couple project infrastructure structure (Git repository, issue tracker etc.) to npm project structure doesn't suit this well.
-