node-modules

How to pass a command line argument to a nested script?

99封情书 提交于 2019-11-28 01:55:13
问题 NOTE: This is NOT about sending args to the top-level script, but to the script called by that script In my package.json, when I call a script that takes command line args directly, it works. But when I call a script that calls that other script, it's not passing the command line args to it. How do i pass them? { ... "takes-args": "somemodule", "calls-takes-args": "npm run takes-args" } When i run the below command, the args come through: npm run takes-args -- -env dev But when I run it

npm WARN install Refusing to install hapi as a dependency of itself

江枫思渺然 提交于 2019-11-27 13:26:37
问题 I tried to do the following (per instructions from official site): mkdir hapi && cd hapi npm init npm install hapi --save But this gives me an error like this: npm WARN install Refusing to install hapi as a dependency of itself Now, I made a new test folder called hapiTest and repeated the commands and then everything worked fine. I tried the same process with a folder gulp and npm install gulp --save , and got the same error, so my conclusion is that I can't have the name of the folder be

How to fix 'fs: re-evaluating native module sources is not supported' - graceful-fs

百般思念 提交于 2019-11-27 09:36:28
问题 Recently I've made a switch to Node v.6, and It started creating more and more problems with running normal builds grunt/gulp/webpack For example: $ gulp [14:02:20] Local gulp not found in ~/_Other/angular-2-ts/angular2-seed [14:02:20] Try running: npm install gulp while gulp and all other plugins and modules are installed (and even re-installed via rm -rf node_modules ) in /node_modules folder. Most of those errors have line like (node:42) fs: re-evaluating native module sources is not

Cannot find the '@angular/common/http' module

倾然丶 夕夏残阳落幕 提交于 2019-11-27 07:44:33
I am following this fundamental tutorial on Angular about Http. As one can see in the "Setup: Installing the module" section, they import the HttpClientModule as follow: import {HttpClientModule} from '@angular/common/http'; When I try this in my project, I get the following error: "Cannot find module '@angular/common/http'". I have tried importing the following module, as follow: import { HttpModule } from '@angular/http'; And then my imports section: imports: [ HttpModule ], The problem now is, I cannot inject this HttpModule into my service object, and I get the following error: "Cannot

How to access node_modules folder from wwwroot in asp.net vnext project

不问归期 提交于 2019-11-27 06:41:11
问题 How can I access the node_modules folder which is not included in the visual studio solution file from the wwwroot where my index.html is put. That index.html file need to reference the npm installed packages like angular.js. But how? I do not want to copy the whole node_modules folder into wwwroot. Those are not the files to live there... I do not want to include the node_modules folder to the solution because that will slow down everything and hang up... It seems Frontend development

Require dependency of another dependency in node modules

大兔子大兔子 提交于 2019-11-27 06:34:10
问题 I've got a simple node app that has single dependency on another app on github. The dependency installs just fine with npm install , but when I try to require something installed there, it says it's not available. For example, the github app installs Mongoose as a dependency. I thought that this parent app would be able to access that module since it is in a child: var mongoose = require('mongoose') The structure looks something like this: /app /node_modules /github_dependency [parent module]

Git - Ignore node_modules folder everywhere

我们两清 提交于 2019-11-27 05:51:28
I have a project containing multiple other projects : Main project Mini project 1 Mini project 2 All containing node_modules folder. I want git to ignore the folder no matter where it is starting from the root folder. Something like this to add in .gitignore : *node_modules/* Add this node_modules/ to .gitignore file to ignore all directories called node_modules in current folder and any subfolders I got into this situation a few times, so I made a one-liner I can paste into terminal in my project directory: touch .gitignore && echo "node_modules/" >> .gitignore Or, when I've added the node

What are differences between SystemJS and Webpack?

拈花ヽ惹草 提交于 2019-11-27 05:46:36
I'm creating my first Angular application and I would figure out what is the role of the module loaders. Why we need them? I tried to search and search on Google and I can't understand why we need to install one of them to run our application? Couldn't it be enough to just use import to load stuff from node modules? I have followed this tutorial (that uses SystemJS) and it makes me to use systemjs.config.js file: /** * System configuration for Angular samples * Adjust as necessary for your application needs. */ (function(global) { // map tells the System loader where to look for things var map

babel JS file can't resolve “@babel/runtime/helpers/builtin/classCallCheck”

假装没事ソ 提交于 2019-11-27 04:50:51
问题 on-rest my project was working great untill I delete my node_modules file and try to re-install npm package. I am getting this error ./node_modules/react-event-listener/dist/react-event-listener.cjs.js Module not found: Can't resolve '@babel/runtime/helpers/builtin/classCallCheck' in '/Users/suatkarabacak/Desktop/demarkedashboard/node_modules/react-event-listener/dist' My package.json is looking like this. { "name": "demo", "version": "0.1.0", "private": true, "dependencies": { "admin-on-rest

“style” field in package.json

蹲街弑〆低调 提交于 2019-11-27 03:50:41
问题 I noticed that Bootstrap and Normalize.css both have a "style" field in their package.json. Why do they have this? If I had to guess, it's to allow users to import the defined stylesheet as easily as doing require('bootstrap') , but that doesn't seem to be the case. 回答1: From Techwraith's pull request that added it to Bootstrap: Many modules in npm are starting to expose their css entry files in their package.json files. This allows tools like npm-css, rework-npm, and npm-less to import