I cannot figure out how to update a dependent package included in Botkit. After running npm install on the package.json below. Npm warns that the hoek package is vulnerable. I've tried running npm audit fix with no resolution. When I run npm ls hoek it shows botkit installed hoek#2.16.3. I don't see why it would install an out of date version.
//package.json
{
"name": "deleteme",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"botkit": "^0.6.16"
}
}
From the npm documentation:
As of npm#2.6.1, the npm update will only inspect top-level packages.
Prior versions of npm would also recursively inspect all dependencies.
To get the old behavior, use npm --depth 9999 update.
See more details here: https://docs.npmjs.com/cli/update
Related
I'm running my first test using percy snapshot using the following command
npm run test:percy
. I got the following error message:
xxx.xxx#LPG002572 TC-Visual % npm run test:percy
npm ERR! missing script: test:percy
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xxx.xxx/.npm/_logs/2020-04-06T16_11_45_122Z-debug.log
jacqueline.george#LPG002572 TC-Visual % npm run test:percy
npm ERR! missing script: test:percy
However my package.json which I double checked seems to be correct. What did I do wrong, and how do I fix it?
{
"name": "tc-visual",
"version": "1.0.0",
"description": "Visual testing with TestCafe and Percy.io",
"main": "index.js",
"scripts": {
"test": "percy exec -- testcafe chrome ./tests"
},
"keywords": [
"TestCafe",
"percy"
],
"author": "xxx xxx",
"license": "ISC",
"dependencies": {
"#percy/testcafe": "^0.2.0",
"testcafe": "^1.8.3"
}
}
The root cause of this problem is that under 'tests' in the package Json. I made an omission. This is very easy to do. So if anyone else is experiencing this issue please be careful because when you modify your package json. As you can see in the updated code I added test:percy
Please see the updated package json with the correct information
{
"name": "tc-visual",
"version": "1.0.0",
"description": "Visual testing with TestCafe and Percy.io",
"main": "index.js",
"scripts": {
"test:percy": "percy exec -- testcafe chrome ./tests"
},
"keywords": [
"TestCafe",
"Percy"
],
"author": "Author",
"license": "ISC",
"dependencies": {
"#percy/testcafe": "^0.2.0",
"testcafe": "^1.8.3"
}
}
This worked for me.
$ percy exec -- testcafe chrome ./tests
'percy' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1
.
yarn add percy or npm install percy
Also percy client was needed after getting this error: Unsupported Percy CLI version, disabling snapshots.
npm install --save-dev #percy/cli
The problem is that when I do npm start OR npm run customScriptCommand npm just not doing anything with the project and quickly just return new line in the terminal.
I've tried removing node and npm from my machine and then do brew installation for node and npm, but it does not fix the problem.
Then I tried removing node and npm from the brew installation and installing it again from nvm, but it also does not fix the problem.
NPM Details
npm -v -> 6.11.3
which npm -> /usr/local/bin/npm
NodeJS Details
node -v -> v12.12.0
which node ->/usr/local/bin/node
Scripts in package.json
"scripts": {
"start": "node ./bin/www",
"devstart": "DEBUG=app-name:* nodemon ./bin/www", //I've changed my actual app name to "app-name"
},
If I do node ./bin/www OR DEBUG=app-name:* nodemon ./bin/www it will work:
Update
I've tried on other project that does not have problem on my colleague's machine, with git clone do npm install and tried to run the project, but it still failed
Even with fresh project which I just did npm init -y it fail,
{
"name": "test"
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "itsme",
"license": "ISC"
}
npm config set ignore-scripts false would do the trick for you.
The struggle is real my friend, not following random tutorials from now.
https://github.com/npm/cli/issues/541
Installing npm install --save-dev nodemon and running npm start did the magic for me
You can install yarn and it works; just run yarn start. As to what caused the problem I have no idea.
I am trying to use the jsonfile package in my project, but I get the following errors:
Refusing to install package with name <packagename> under a package also called <packagename>. (Note that none of the directory or filename is same as package name)
Cannot find module <packagename>.
The problem is caused when the name of project in package.json is the same as the module you're trying to install.
To solve this problem, please change the project name in package.json to something else. For example, "jsonfile-test":
{
"name": "jsonfile-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
}
}
I think it should be:
npm install --save json-file
not
npm install --save jsonfile
ref: https://www.npmjs.com/package/json-file
If that does not work please try enabling permissions install - e.g. (on mac- but will be equivalent on windows, check: https://helpdeskgeek.com/free-tools-review/5-windows-alternatives-linux-sudo-command/) run:
sudo npm install --save json-file
I wanted to setup webpack and babel with npm, but I got this error
npm ERR! Unexpected end of JSON input while parsing near '...pdragon":"^0.7.0","to' npm ERR! A complete log of this run can be found in:
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\luchan.vladyslav\AppData\Roaming\npm-cache\_logs\2017-12-10T10_48_56_298Z-debug.log
here is my package.json
{
"name": "ddd",
"version": "1.0.0",
"description": "components",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.1"
}
}
At the begining I have tried to install webpack webpack-dev-server babel-core babel-loader and babel-preset-env in one line. But I got this error, after a while I figured out that problem is related to webpack and wepback-dev-server
screenshot
Looks like the corrupt local node_modules is to be blamed. Can you remove the local node_modules folder and then freshly install by `npm install' ? That should fix the issue.
To solve this problem you should clean your cache with
npm cache clean --force
That will solve the problem
This is truly frustrating.
Package.json for a repo hosted on github as part of my organisation. I am trying to pull this in via jspm.
{
"name": "tf-modernizr",
"version": "1.0.0",
"description": "",
"main": "modernizr.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tomorrowfinance/tf-modernizr.git"
},
"author": "Simon Douglas",
"license": "MIT",
"bugs": {
"url": "https://github.com/tomorrowfinance/tf-modernizr/issues"
},
"homepage": "https://github.com/tomorrowfinance/tf-modernizr#readme",
"directories": {}
}
npm install works fine (!!!)
running jspm install:
jspm install github:tomorrowfinance/tf-modernizr#master
or jspm install github:tomorrowfinance/tf-modernizr informs me there is a 404.
Looking up github:tomorrowfinance/tf-modernizr
Updating registry cache...
Downloading github:tomorrowfinance/tf-modernizr#master
warn Error on download for github:tomorrowfinance/tf-modernizr
Bad response code 404
err Error downloading github:tomorrowfinance/tf-modernizr.
The documentation here http://jspm.io/docs/getting-started.html doesn't help. The documentation here https://github.com/jspm/registry/wiki/Configuring-Packages-for-jspm is complex. What am I missing?
Since this is a private repository, you need to allow jspm to access it.
Simply configure access to github using: jspm registry config github