All Questions
Tagged with package javascript
378
questions
1044
votes
19
answers
773k
views
How to list npm user-installed packages?
How do I list the user-installed / environment package only in npm?
When I do npm -g list, it outputs every package and their dependencies. Instead I'd like to see the packages installed in the ...
679
votes
11
answers
571k
views
Installing a local module using npm?
I have a downloaded module repo, I want to install it locally, not globally in another directory?
What is an easy way to do this?
153
votes
8
answers
208k
views
Print a list of all installed node.js modules
In a node.js script that I'm working on, I want to print all node.js modules (installed using npm) to the command line. How can I do this?
console.log(__filename);
//now I want to print all ...
131
votes
6
answers
91k
views
How can I update bower.json with installed packages?
In my project I've installed Bower components without the save option. Now, I would like update to bower.json.
How can I update bower.json with installed packages?
126
votes
3
answers
63k
views
Do you put Babel and Webpack in devDependencies or Dependencies?
I'm new to npm and don't really understand what should go into dependencies vs. devDependencies. I know that for testing libraries they should go into dev, but how about for things like babel and ...
111
votes
3
answers
21k
views
What are `rc` files in nodejs?
I have some questions regarding various rc files in a typical node application, like .npmrc, .babelrc etc.
What is an rc file, I know its a runtime-config for the module, but anything else?
Does the ...
99
votes
4
answers
31k
views
Automatically Build NPM Module On Install From Github
Given that a project's lib/ dir shouldn't be checked into Git because the files it contains are derived files (from the build process). When installing a package from the project's github (during ...
86
votes
12
answers
188k
views
Unable to resolve dependency tree Reactjs
I am trying to install react-tinder-card in my current project. So I am trying to install the react-tinder-card but after I use the command
npm install --save react-tinder-card
All I can see in my ...
64
votes
2
answers
32k
views
what does grunt "test command" do on npm init
I'm trying to learn grunt. When I run npm init, I get a prompt in the process of creating a package.json file that asks for "test command" - I'm not sure how to utilize this, or what it's expecting. ...
62
votes
4
answers
42k
views
How to register a local git package in Bower?
How can I register a local git package in bower?
My current component.json is as follows
{
"name": "myproject",
"version": "1.0.0",
"dependencies": {
"jquery": "1.8.0",
"twitter/...
27
votes
3
answers
21k
views
how do i confirm i'm using yarn link correctly?
How can I tell my local linked package is in use rather than from remote? Is it suppose to show up in the dev server of my local package?
24
votes
7
answers
20k
views
TypeError: environment.setup is not a function in React Testing
I was trying to implement the example shown in Jest website: Getting started with Jest.
While running npm test on I was getting the following error:
FAIL src/sum.test.js
● Test suite failed to ...
21
votes
1
answer
12k
views
Failed doing npm install showing error "Undefined variable standalone_static_library in binding.gyp" and node-sass chokidar error
I'm updating a 3 years ago ruby on rails and react project trying to npm install but im stuck here getting this error
$ npm install
gyp: Undefined variable standalone_static_library in binding.gyp ...
21
votes
1
answer
26k
views
You can mark the path "..." as external to exclude it from the bundle - how?
I have a repository that I published to a package. I installed this package in another repository and want to use it but I get an error: (where the ... are the name of any package that trying to ...
20
votes
4
answers
14k
views
JavaScript - package is a reserved keyword
I am trying to minify a third-party JavaScript library using Google Closure Compiler, but it errors out at below line:
inBlock.package = package = name
The error is
ERROR - Parse error. missing ...
17
votes
1
answer
2k
views
What is the preferred way to publish a wasm library on npm?
Is there a good way to publish a library that uses a wasm binary on npm ?
So far, I encountered several issues. Ideally, I would like something that would be :
Totally transparent to the user. They ...
15
votes
2
answers
11k
views
How to choose a CDN to load JavaScript & CSS libraries
What kind of reasoning should I do in order to choose a specific Content Delivery Network (CDN) to load JavaScript and CSS libraries into my website development projects?
I see that there are some ...
13
votes
5
answers
28k
views
React import multiple components from a folder
I am trying to import 2 components from the components folder. Both components' class are export default .
However, I got an error message that I should use the curly braces in my import statement. ...
12
votes
4
answers
20k
views
How can I find rollup 3.1.0 update error?
i want to install rollup-plugin-visualizer but its need to update rollup.
updated rollup from 1.8.0 to 3.1.0
got error
[!] RollupError: Node tried to load your configuration file as CommonJS even ...
12
votes
2
answers
7k
views
Node.js: Get (absolute) root path of installed npm package
Task
I'm looking for an universal way to get the (absolute) root path of an installed npm package in Node.js.
Problem
I know about require.resolve, but that will give me the entry point (path to ...
11
votes
1
answer
4k
views
Webpack - No Output File, No Errors Reported
I am learning Webpack and going through it again and again. In the latest build, there is something very strange going on. CLI reports everything is well & the output file dress_aphrodite.js is ...
10
votes
2
answers
14k
views
Where to put frontend javascript configuration variables
I have a Javascript frontend that does Ajax calls to my backend. To do that, it needs a "backend_URL" that I hard-coded in the Ajax get() call, say "http://myservice/backend".
Now if I want to ...
10
votes
6
answers
4k
views
npm installs many dependencies
I bought an HTML template recently, which contains many plugins placed inside a bower_components directory and a package.js file inside. I wanted to install another package I liked, but decided to use ...
10
votes
1
answer
3k
views
How to Share Build Scripts In Lerna Packages
I have a lerna repo that contains multiple packages organised in the usual structure:
package.json
/packages
- alpha
package.json
- bravo
package.json
- charlie
package.json
I need ...
10
votes
3
answers
4k
views
Package html, js, css as a desktop app
I have a online tool where you can make presentations and then either preview them right online or download them for use later in a presentation. This have been done in flash. An xml is created for ...
9
votes
6
answers
27k
views
What needs to change in this package.json file to work with npm 0.3.0?
Trying to use a lib but getting this error...
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse Note that package.json must be actual JSON, not
npm ERR! JSON.parse just a ...
9
votes
1
answer
3k
views
Can't get external library with browserify and debowerify
I have a headache on my hands. Here's my current setup:
bower to get vendor libraries (angular in this case)
gulp task to run browserify
debowerify to make the bower libraries compatible with ...
9
votes
1
answer
2k
views
Node: check latest version of package programmatically
I'd like my node package (published on npm) to alert the user when a new version is available. How can i check programmatically for the latest version of a published package and compare it to the ...
9
votes
1
answer
11k
views
Debug javascript code in atom ide
I ask if there is a solution or a package to install in atom so that I can debug javascript (when using node) in the IDE, like the one offered by Visual Studio Code.
Thank you in advance.
8
votes
2
answers
13k
views
Node mssql: return id after SQL insertion
I am working on an integration between Mongodb and SQL Server, inserting and updating registers from MongoDb to SQL Server database with a scheduled process, using the mssql package to achieve this.
...
8
votes
1
answer
5k
views
Javascript equivalent to python __init__.py
In python, in order to expose top-level functionality in a package, one would create an __init__.py
#__init__.py
from .implmentation import impl_function
def exposed_fn():
"""call impl_function
...
7
votes
17
answers
20k
views
error An unexpected error occurred: "EPERM: operation not permitted, unlink 'path_to_project\\node_modules\\prisma\\query_engine-windows.dll.node'
I installed Prisma and I run npx primsa db push it pushed all tables to database successfully, after that I run npx prisma generate it tried to install @prisma/client and it fails with this error ...
7
votes
2
answers
5k
views
MainApplication.java in React Native 0.61.0
I'm migrating my project from React Native 0.59.9 to 0.61.0 (not advisable, but I have my own reasons). In my existing project I have the following code in MainApplication.java:
@Override
protected ...
7
votes
1
answer
8k
views
Package to translate a cron to a "simpler" human readable format?
I've been looking all over the internet for an NPM package that could achieve this, but I haven't been able to find one.
What I'm looking for is quite simple on the surface. A cron library that can ...
7
votes
1
answer
3k
views
Run some Javascript file like index.js in Flutter Webview
how I can run Javascript file in the flutter_webview_plugin. I try it with this.
flutterWebViewPlugin.evalJavascript("require('./index.js');");
But nothing happens.
when I try to run flutter code ...
6
votes
1
answer
4k
views
Why I'm getting Cannot read property 'tagName' of null on a SVG?
I'm getting this error after I've updated the packages in my package JSON file.
./src/assets/img/pickUp.svg (./node_modules/@svgr/webpack/lib?-svgo,+titleProp,+ref!./src/assets/img/pickUp.svg)
...
6
votes
1
answer
236
views
How do you create array literals with HJScript or indeed HJavaScript?
In HJavaScript there is the Array type, but I can't see a way of constructing a literal that would translate, for example, to JS as [1,2,3]. I don't want to have to create a new Array() and then push ...
6
votes
2
answers
3k
views
Why doesn't the Pod dependency manager detect the necessary modules for installation?
So this question is a follow up to my previous question:
How can different apps import from a shared components folder? react / react-native
So I've created my own npm module which I store all my ...
6
votes
2
answers
4k
views
How can I import React Components as a package/module from some other(non-project) directory?
I have a couple of React Components in a folder, which is not a react project. The Directory Structure i am following for components is:
~/components/Component1/index.jsx
~/components/Component2/...
5
votes
1
answer
6k
views
How to change NPM version? [duplicate]
I am trying to install some packages for React-Native project but its shows me NPM version error so, How can I upgrade.
My current version is 4
5
votes
1
answer
791
views
I am get an export error when build test? [closed]
When running tests in React with Enzyme, I am getting the following error:
"Error: Package subpath './lib/utils' is not defined by "exports" in ...\node_modules\cheerio\package.json.&...
5
votes
1
answer
444
views
Laravel 8 ConsoleTvs 7 - Apply dataset configuration through extra argument of advancedDataset method
I am sending my data to the front-end of ConsoleTvs 7 Chartisan chart using the built in back-end advancedDataset method. As the third parameter I decided to send extra dataset configurations in array ...
5
votes
1
answer
535
views
Optimum JavaScript package size
When you serve JavaScript to a page it is best to serve one packaged, minified and gzipped file to reduce latency and request times.
But is it better to send
One big package for your entire website
...
5
votes
1
answer
2k
views
How to make npx work with my custom npm pakage?
I've published a new package which aims to generate a very small boilerplate for a node open source project via cli. For now, it's just a combination of few npx commands and requires other npm ...
5
votes
3
answers
1k
views
How to create a JavaScript Library
I've created some functions in JavaScript.
I've found out that I reuse them in many projects.
So I decided to create a small JavaScript Library for my coding.
A Library like react, react-dom, jquery ...
5
votes
3
answers
5k
views
Node.js package self-reference
Can package require itself and its subsystems?
For instance there is module:
src/deep/path/to/module.js
which need to require
src/another/module.js
Instead of:
require('./../../../another/module.js'...
5
votes
1
answer
5k
views
Module parse failed: The keyword 'interface' is reserved (5:0) File was processed with these loaders
It is my first time publishing package to NPM. I have published simple React + TypeScript component to NPM, but when I installed and tested it, I am getting the error below. I saw other Q&A but ...
5
votes
0
answers
3k
views
How to satisfy libraries that depend on different versions of React? NPM
Hi guys I have a problem with NPM dependencies.
It turns out that in my project, I'm using React version 17.0.2 but I have several libraries that depend on React 16.3.2 and I really don't know what to ...
5
votes
0
answers
823
views
How to update npm package readme file without updating version?
When I need to update my npm package readme file , I need to update it's version. Is it possible to update readme file without version update?
5
votes
0
answers
439
views
How to write and distribute a Javascript module for both NPM and direct browser use
I want to write a single Javascript module that can be used both through NPM/Browserify:
let mymodule=require('mymodule');
mymodule.foo()
and alternatively by linking to a hosted version without ...