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.
21,796
questions with no upvoted or accepted answers
34
votes
2
answers
13k
views
Looking for a Dual Listbox with AngularJS and Bootstrap
I am looking for a component like this to be included in my project:
http://geodan.github.io/duallistbox/sample-100.html
I want to install it with npm.
The problem is that I tested some of the ...
29
votes
1
answer
676
views
StriderCD global post install fails on bower access to $HOME/.config $HOME/.cache
I am trying to work out the best way to install StriderCD globally. I installed node and npm via the global-enabled fork of nvm, and all paths are working fine for other builds, but none of them ...
24
votes
2
answers
11k
views
How do I install dependencies for a single package when using npm workspaces?
Using npm workspaces I have a folder structure like this
+-- package.json
+-- package-lock.json
+-- client
| `-- package.json
+-- shared
| `-- package.json
`-- server
`-- package.json
...
22
votes
1
answer
2k
views
How to split chunks when authoring libraries with webpack 4?
I'm trying to publish a custom react component to a private repository.
I use react-loadable to load a subcomponent on demand. When running locally, everything works fine. The index.js file ...
21
votes
1
answer
3k
views
Why must I run "npm install" twice for my package to install successfully
The first time I "npm install" package_1, I get the following error.
npm ERR! path C:\Users\john_\Documents\GitHub\why_npm_nesting_fails\package_1\node_modules\.staging\bignumber.js-55edd243
I don't ...
17
votes
3
answers
4k
views
Different package versions for Android and iOS
I am developing an app for both Android and iOS using React Native.
One of the libraries I'm using is a bit problematic because the app only compiles correctly:
...on Android when using "react-...
15
votes
1
answer
6k
views
(Handle Polyfill.io Security-Alert) How do you detect if a big npm Codebase uses Polyfill.io somewhere?
Polyfill.io is malicious: https://dev.to/snyk/polyfill-supply-chain-attack-embeds-malware-in-javascript-cdn-assets-55d6
I now need to find it my codebase:
I used: grep -r "polyfill.io" to ...
15
votes
1
answer
5k
views
Using --ignore-scripts for one dependency in NPM
Following this question, NPM dependencies can be installed using:
$ npm install --ignore-scripts
Is there a way to mark that a dependency should be installed without running scripts in package.json?
...
15
votes
2
answers
4k
views
Generate declaration file with single module in TypeScript
Given the following folder structure:
src/
├── foo.ts
├── bar.ts
├── baz.ts
├── index.ts
Where foo.ts, bar.ts, and baz.ts each export a default class or thing: i.e. in the case of foo.ts:
export ...
14
votes
0
answers
888
views
Can a package be published to both github and npm? (with a single `npm publish`)
I got access to the github package registry beta, just fiddled with it and followed the configuration steps to publish.
The thing is, I published it correctly, but noticed it didn't publish to npm. ...
14
votes
2
answers
1k
views
Issue adding third-party (external ) js lib in angular5
I am working on to add jsplumb community js library version with the angular 5 application (Angular CLI: 1.6.1).
With the first build without any configuration to tsconfig.json I get the following ...
13
votes
0
answers
550
views
Is there a way to prevent npm from creating symlinks of workspace packages inside node_modules?
We are working on a monorepo that uses npm workspaces. One of the directories in this project is special in the sense that we don't want to allow packages within this directory to create imports to ...
13
votes
0
answers
495
views
npm workspaces - skip `src` folder when importing source files from symlinked shared package
I have a typescript monorepo setup that uses npm workspaces and I want to be able to import subpaths down to any individual typescript file of @package/shared in @package/client and @package/server ...
13
votes
2
answers
9k
views
WebPack - TypeError: __webpack_modules__[moduleId] is not a function (development) // Error: Invalid hook call (production)
I'm struggling with a WebPack error that occur when I use my custom library hosted as a package and streamed with NPM Link. Meanwhile, the production version works perfectly
Here is my scripts
"...
12
votes
0
answers
4k
views
PhantomJS attempting to install as if OS is Linux/arm64 when I am using Mac Big Sur?
I am receiving the below error message when running npm install on a project:
#10 35.10 PhantomJS not found on PATH
#10 35.10 Unexpected platform or architecture: linux/arm64
#10 35.10 It seems ...