npm-install

Installing 3rd Party Applications with Angular-CLI

限于喜欢 提交于 2019-12-03 21:49:29
I am new to angular-cli. I want to install the npm library mdbootstrap. I followed the instructions here: Angular CLI Instructions Specifically, I did this: I installed mdbootstrap via npm install bootstrap . I added all of the files in the dist directory to my angular-cli.json . angular-cli.json additions: "styles": [ "../node_modules/mdbootstrap/css/bootstrap.min.css", "../node_modules/mdbootstrap/css/mdb.min.css", "../node_modules/mdbootstrap/css/style.css" ], "scripts": [ "/node_modules/mdbootstrap/dist/js/bootstrap.min.js", "/node_modules/mdbootstrap/dist/js/jquery-3.1.1.min.js", "/node

How to prevent nested node_modules inside node_modules

末鹿安然 提交于 2019-12-03 20:44:57
问题 I've created my own npm package, let's call it XYZ, it has @material-ui dependency in it's package.json file. When I install it in project A I have nested node_modules inside of XYZ folder(so it's A\node_modules\XYZ\node_modules\@material-ui ), but when I install it in project B I don't have nested node_modules folder. Both project A and B has @material-ui in their package.json files with same versions. How to force my XYZ package to use @material-ui from A\node_modules ? 回答1: There are

cleancss command not working

♀尐吖头ヾ 提交于 2019-12-03 20:36:18
I installed clean-css locally but my npm script is throwing an error because cleancss is not found ( sh: cleancss: command not found ). I tried running cleancss straight from the command line and installed it globally ( npm install -g clean-css ) but my shell still doesn't know about it. All other packages are working fine. Here's what my package.json looks like: { "scripts": { "lint": "echo '=> linting' && jshint **/*.js", "minify:js": "echo '=> minify:js' && uglifyjs main.js -o public/js/main.min.js", "minify": "echo '=> minify:css' && cleancss main.css -o public/css/main.min.css" },

Angular cli not using global npm install

白昼怎懂夜的黑 提交于 2019-12-03 15:22:32
问题 I am new to npm and node, i am learning angular. In an angular cli project, whenever i run ng <<'keyword'>> command, i am getting below error as its unable to find global npm-modules folder. node_modules appears empty, you may need to run npm install Tried following configuration but no luck, i have to run npm install in every project to overcome the problem. export NODE_PATH=/usr/local/lib/node_modules PATH=$PATH:/usr/local/bin/node PATH=$PATH:/usr/local/bin/npm Is there way that i can avoid

How to specify registry while doing npm install with git remote url?

独自空忆成欢 提交于 2019-12-03 15:04:08
问题 I want to be able to clone a git repository using a URL as specified here <protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish>] I am getting an error saying npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/XYZ So I should also be able to specify the registry while doing since modules are supposed to be picked up from a internal repository. Is it possible to specify registry while doing npm install with git remote url ? 回答1: npm gets its

npm install not creating a new package-lock.json

痞子三分冷 提交于 2019-12-03 10:30:21
问题 I accidentally deleted my package-lock.json file. npm install is not generating a new one. How do I get npm to recreate this file. 回答1: The package-lock.json file was introduced in npm v5, so the steps you need to take to regenerate package-lock.json depend on which version of npm you're using. FYI. Let's verify what version of node and npm. npm -v prints: x.x.x node -v prints: x.x.x I believe for package-lock.json is auto-generated if the 2 conditions npm version > 5.x.x and node version > 7

node_modules/.bin/package.cmd file in node js

ⅰ亾dé卋堺 提交于 2019-12-03 08:48:44
I am new to node js. I am trying to build a npm module and confused a bit with cmd file present in /node_modules/.bin folder with the name of the package locally. I installed multiple packages as dependencies and found that cmd files are different. jade.cmd @IF EXIST "%~dp0\node.exe" ( "%~dp0\node.exe" "%~dp0\..\jade\bin\jade" %* ) ELSE ( @SETLOCAL @SET PATHEXT=%PATHEXT:;.JS;=;% node "%~dp0\..\jade\bin\jade" %* ) mocha-casperjs.cmd @IF EXIST "%~dp0\/bin/sh.exe" ( "%~dp0\/bin/sh.exe" "%~dp0\..\mocha-casperjs\bin\mocha-casperjs" %* ) ELSE ( @SETLOCAL @SET PATHEXT=%PATHEXT:;.JS;=;% /bin/sh "%~dp0

How to fix NPM package Tar, with high vulnerability about Arbitrary File Overwrite, when package is up to date?

眉间皱痕 提交于 2019-12-03 06:30:32
问题 I just installed Flickity from NPM and got an NPM Audit Security Report after running npm audit stating that I have a high vulnerability issue regarding Arbitrary File Overwrite on package tar which is a dependency of node-sass as you can see here: High......................... Arbitrary File Overwrite Package...................... tar Patched in................... >=4.4.2 Dependency of................ node-sass [dev] Path......................... node-sass > node-gyp > tar More info.........

npm - using stale package data

孤街浪徒 提交于 2019-12-03 06:11:41
问题 Whenever I do an npm install, I get a ton of messages about it using stale package data. What does that mean and is it something I need to worry about? Here's a small example of the warning messages I get with an npm install. In this particular example I just added "npm install @angular/animations@latest --save": WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha512-Mp+FXEI+FrwY/XYV45b2YD3E8i3HwnEAoFcM0qlZzq/RZ9RwWitt2Y

How to specify registry while doing npm install with git remote url?

假装没事ソ 提交于 2019-12-03 05:50:38
I want to be able to clone a git repository using a URL as specified here <protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish>] I am getting an error saying npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/XYZ So I should also be able to specify the registry while doing since modules are supposed to be picked up from a internal repository. Is it possible to specify registry while doing npm install with git remote url ? Alexandr Lazarev npm gets its config settings from the command line, environment variables, and npmrc files. You can try to