npm

VSC PowerShell. After npm updating packages .ps1 cannot be loaded because running scripts is disabled on this system

佐手、 提交于 2021-02-05 12:52:13
问题 I design websites in VSC and PowerShell is my default terminal. After updating and deploying a website to firebase earlier, I was prompted to update firebase tools - which I did using npm. Immediately after I cannot run/access any firebase scripts wthout the folllowing error: firebase : File C:\Users\mada7\AppData\Roaming\npm\firebase.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/

How do you use the 'files' and 'directories' properties in package.json?

人走茶凉 提交于 2021-02-05 12:42:13
问题 If a package.json has a files prop, and/or a directories prop: "files": [ "./src/assets/fonts/" ], "directories": { "assets:": "./src/assets" } What are some ways to make use of them? The documentation does not mention what can be done with them once they have been specified. For example, the files docs say: The "files" field is an array of files to include in your project. If you name a folder in the array, then it will also include the files inside that folder. What does "include in your

How to include the path for the node binary npm was executed with

拈花ヽ惹草 提交于 2021-02-05 12:42:07
问题 Windows, VSC, Running npm start got this npm WARN lifecycle The node binary used for scripts is C:\Program Files\nodejs\node.exe but npm is using C:\somewhere\AppData\Roaming\npm\node_modules\node\bin\node.exe itself. Use the --scripts-prepend-node-path option to include the path for the node binary npm was executed with. I understand it means my local version is diff from the one in the PATH variable (C:\Program Files...). How do proceed to tell it to use --scripts-prepend-node-path ? I

How do you use the 'files' and 'directories' properties in package.json?

时光怂恿深爱的人放手 提交于 2021-02-05 12:42:06
问题 If a package.json has a files prop, and/or a directories prop: "files": [ "./src/assets/fonts/" ], "directories": { "assets:": "./src/assets" } What are some ways to make use of them? The documentation does not mention what can be done with them once they have been specified. For example, the files docs say: The "files" field is an array of files to include in your project. If you name a folder in the array, then it will also include the files inside that folder. What does "include in your

README is deformed in npmjs but appears in github

爷,独闯天下 提交于 2021-02-05 11:44:33
问题 The readme file is represented as a binary file in npmjs.com but not in github.com screeshot: Url to the package github: https://github.com/scicave/rakam npmjs: https://npmjs.com/package/rakam 回答1: Your README.md is encoded as little-endian UTF-16, with mixed line endings: $ file README.md README.md: Little-endian UTF-16 Unicode text, with very long lines, with CRLF, CR line terminators UTF-16 is fairly uncommon these days; UTF-8 has largely replaced it. Consider re-encoding your file as UTF

'CALL “C:\Program Files\nodejs\\node_modules \npm\bin\npm-cli.js” prefix -g' is not recognized as an internal or external com mand,

蹲街弑〆低调 提交于 2021-02-05 11:26:08
问题 C:\Users\MNE GO DIGITAL>npm 'CALL "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\\node_modules \npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external com mand, operable program or batch file. i have installed nodejs on c drive when i hit npm --v also it state this same error C:\Users\MNE GO DIGITAL>npm 'CALL "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\\node_modules \npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external

Is there a way to get the name of the npm script passed to the command specified by that script?

半腔热情 提交于 2021-02-05 09:14:07
问题 With npm or yarn, is it possible for the script specified by an npm script to know the name of the npm script itself? For example: "scripts": { "foo": "echo Original command: $0", "bar": "echo Original command: $0" } I'd like the result of those two scripts to be something like: Original command: yarn run foo Original command: yarn run bar But all I actually get is: Original command: /bin/sh . And in case it makes a difference, it's just the name of the script I need, not the yarn run part,

How do I omit a package from being included in my yarn.lock file?

故事扮演 提交于 2021-02-05 09:12:47
问题 So in my package.json I have a bunch of npm libs, and one private repo being pulled in from a git ssh url which needs to always be the latest build. The yarn.lock adds the git sha and yarn upgrade etc won't grab the newest one. Basically, given this: "dependencies": { "some-package" : "^0.x.x", "some-other-package" : "*", "my-private-git-repo" : "git+ssh://git@bitbucket.org/me/myrepo.git", "lastlibrary" : "^4.0.3" }, I want yarn.lock or npm shrinkwrap to ignore my-private-git-repo Is this

Problems with “zsh: command not found: sails”

心不动则不痛 提交于 2021-02-05 07:52:25
问题 I installed sails.js with via sudo npm install -g sails but i'm still getting zsh: command not found: sails I'm using Ubuntu 14.04 LTS. 回答1: First find out path for node which node will return something like /path/bin/node enter that location to bin cd /path uninstall present node by running rm -r bin/node bin/node-waf include/node lib/node lib/pkgconfig/nodejs.pc share/man/man1/node.1 then you'll want to install nvm by running curl https://raw.githubusercontent.com/creationix/nvm/v0.19.0

What does “npm audit fix” exactly do?

我是研究僧i 提交于 2021-02-04 22:11:56
问题 npm audit fix is intended to automatically upgrade / fix vulnerabilities in npm packages. However, I haven't found out what it exactly does to fix those vulnerabilities. I assumed that npm audit fix would upgrade dependencies and dependencies' dependencies to the latest versions that are allowed by the semver-definitions of the packages – effectively the same as rm package-lock.json; npm install . However npm audit fix still performs a lot of changes after lock file removal + reinstall. What