Need help installing node-dev - javascript

I am new to node.js and I am trying to install node-dev. Everytime I try to install I get his following error message:
npm WARN deprecated object-keys#0.2.0: Please update to the latest object-keys
/usr/local/bin/node-dev -> /usr/local/lib/node_modules/node-dev/bin/node-dev
node-dev#2.6.1 /usr/local/lib/node_modules/node-dev
├── filewatcher#1.1.2
├── resolve#1.1.6
├── node-notifier#4.1.2 (which#1.0.9, shellwords#0.1.0, clone#0.1.19, growly#1.2.0, semver#4.3.3)
├── dynamic-dedupe#0.2.0 (xtend#2.0.6)
└── dateformat#1.0.11 (get-stdin#4.0.1, meow#3.1.0)
I know it didn't install because when I run a script, it brings me back to the command prompt, instead of waiting for a change in file for it to restart automatically.
Any help would be really appreciated. Thanks!

Related

ERROR Extension entrypoint(s) missing while I'm trying to package a developed vscode extension with vsce

I'm developing a VSCode extension to automate some edit & search processes. Everything runs Ok! in the Extension Development Host but when I try to package the extension with vsce inside the extension's folder the app responds with this error:
ERROR Extension entrypoint(s) missing. Make sure these files exist and aren't ignored by '.vscodeignore':
extension/extension.js
At the extension's manifest(package.json) the entrypoint to the extension code is defined in the "main" key:
...
"activationEvents": [
"onCommand:extension.findBlock"
],
"main": "./extension.js",
"contributes": {
"commands": [
{
"command": "extension.findBlock",
"title": "Find Block"
}
],
...
In the extension's folder everything is as the visual studio extension generator(yo) left it.
.
├── block_finder.code-workspace
├── CHANGELOG.md
├── extension.js
├── findBlock.png
├── jsconfig.json
├── node_modules
├── package.json
├── package-lock.json
├── prueba.txt
├── README.md
├── test
└── vsc-extension-quickstart.md
Am I missing something? I don't understand what could be happening. My VSCode version is 1.65.2 and vsce is 2.7.0. Thanks!
I came back to say that I solved the problem by uninstalling the npm manager. The version I had installed was old and I noticed that in the installation of the extension requirements it installed packages with warnings of deprecated versions. I uninstalled npm and did a clean install and my extension started working as expected. Sorry for leaving this post open and thanks for all the help you have given me.

Updating version of dependency in package-lock.json

How to update version of a dependency which is required by other dependencies.
├─┬ vue-svgicon#3.2.9
│ └─┬ yargs#12.0.5
│ └── yargs-parser#11.1.1
In my case, yargs-parser needs to be updated to 13.1.1. Making any changes in the package-lock.json just overwrites it when you run npm install.
npm audit fix doesnt update it either
Tried doing with npm-shrinkwrap.json as an override for package-lock.json but want to find out some other alternative.
Another alternative is to do a define
"resolutions"
in the package.json file in addition to
"preinstall": "npm-force-resolutions"
but this adds an additional dependency of npm-force-resolutions which is not desired

Create React App with Storybook creating webpack issue

So I have a large React app created and set up with Create React App. Recently we started using Storybook to work on and create components. Its been great. However, we keep getting this weird webpack issue when we try to run or build the app. Here is the console log out:
> react-scripts start
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"webpack": "4.41.2"
Don't try to install it manually: your package manager does it automatically.
However, a different version of webpack was detected higher up in the tree:
/Users/alexanderkaran/Documents/ClimateClever/cc_school_web/node_modules/webpack (version: 4.41.5)
Manually installing incompatible versions is known to cause hard-to-debug issues.
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.
To fix the dependency tree, try following the steps below in the exact order:
1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
2. Delete node_modules in your project folder.
3. Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.
4. Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
This may help because npm has known issues with package hoisting which may get resolved in future versions.
6. Check if /Users/alexanderkaran/Documents/ClimateClever/cc_school_web/node_modules/webpack is outside your project directory.
For example, you might have accidentally installed something in your home folder.
7. Try running npm ls webpack in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed webpack.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.
P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cc_school_web#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cc_school_web#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alexanderkaran/.npm/_logs/2020-01-23T05_20_16_003Z-debug.log
alexanderkaran#AlexandersMBP2 cc_school_web %
I know what your thinking you must have installed webpack, well I didn't. When I run:
npm ls webpack
I get this log out:
cc_school_web#0.1.0 /Users/alexanderkaran/Documents/ClimateClever/cc_school_web
├─┬ #storybook/react#5.3.8
│ ├─┬ #storybook/core#5.3.8
│ │ ├─┬ corejs-upgrade-webpack-plugin#2.2.0
│ │ │ └── webpack#4.41.5 deduped
│ │ └── webpack#4.41.5 deduped
│ └── webpack#4.41.5
└─┬ react-scripts#3.3.0
└── webpack#4.41.2
alexanderkaran#AlexandersMBP2 cc_school_web %
So the issue seems to be to do with storybook. If I uninstall all npm modules and remove storybook, then re-add both everything works again but eventually, it breaks.
Does anyone have a fix for this? Or am I missing something?
Looks like this an issue with the version of Webpack Create React App uses being a few steps behind the version Storybook uses sometimes.
There is no fix, but there are some workarounds.
You can find more info on the issue here:
https://github.com/storybookjs/storybook/issues/6505
One workaround is to add SKIP_PREFLIGHT_CHECK=true to a .env file in your project.
This can cause issue though.
Another workaround is to keep using a version of storybook and create react app that works with each other and doesn't cause these issues. So do not just upgrade storybook straight if it contains a Webpack version bump.

npm missing package error

When I build my js application, I get error that a package(say A#0.94.2) is missing.
I do:
npm list A
This gives me a tree structure like this:
├── A#0.94.2
└─┬ B#0.94.3
└── A#0.94.2 deduped
What does it mean?
Also, it seems A#0.94.2 is available, so why do I get error?
Edit: NPM verions is 5.6.0

Kibana bootstrapping with Yarn - Errors 800A0404/800A1391

UPDATE 2: Unfortunately, it doesn't work on my other computer either. While elasticsearch boots just fine, kibana.bat gives an "Unable to find usable node.js executable" message on boot. Though I know it's dangerous, I think I am just going to try to develop on the production version of Kibana from the Elastic website. Should I submit a bug request about this?
UPDATE 1: I went into the kibana\packages\kbn-babel-preset\node.js file & got rid of some of the commas at the end of lists/dictionary objects, which fixed the 800A0404 error, but caused another:
Script: C:\Users\super\OneDrive\Documents\kibana\packages\kbn-babel-preset\node.js
Line: 1
Char: 1
Error: 'module' is undefined
Code: 800A1391
Source: Microsoft JScript runtime error
Dismissing this popup allows the bootstrap to continue until hitting the eslint-import-resolver-kibana directory:
Installing dependencies in [#kbn/eslint-import-resolver-kibana]:
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.1.3: The platform "win32" is incompatible with this module.
info "fsevents#1.1.3" is an optional dependency and failed compatibility check.
Excluding it from installation.
[3/4] Linking dependencies...
warning " > eslint-import-resolver-webpack#0.8.4" has unmet peer dependency "esl
int-plugin-import#>=1.4.0".
[4/4] Building fresh packages...
[1/1] ⠈ uglifyjs-webpack-plugin
[-/1] ⠈ waiting...
[-/1] ⠈ waiting...
[-/1] ⠈ waiting...
error C:\Users\super\Documents\kibana\packages\kbn-eslint-import-resolver-kibana
\node_modules\uglifyjs-webpack-plugin: Command failed.
Exit code: 1
Command: node lib/post_install.js
Arguments:
Directory: C:\Users\super\Documents\kibana\packages\kbn-eslint-import-resolver-k
ibana\node_modules\uglifyjs-webpack-plugin
Output:
module.js:549
throw err;
^
Error: Cannot find module 'C:\Users\super\Documents\kibana\packages\kbn-eslint-i
mport-resolver-kibana\node_modules\uglifyjs-webpack-plugin\lib\post_install.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
[bootstrap] failed:
Error: Command failed: yarn install --non-interactive --mutex file
at makeError (C:\Users\super\Documents\kibana\packages\kbn-pm\dist\index.js:
38964:9)
at Promise.all.then.arr (C:\Users\super\Documents\kibana\packages\kbn-pm\dis
t\index.js:39069:16)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Once again: any advice is greatly appreciated!
ORIGINAL: I am new to Kibana plugin & JavaScript development & would appreciate some help with an error I have been attempting to troubleshoot for a little while now.
I am attempting to set up my developer environment for creating Kibana plugins as per this guide. However, I only just recently started getting the following popup error from the Windows Script Host on running the yarn kbn bootstrap command in the cloned kibana directory, shortly after cloning the Kibana Github directory and installing Yarn & Node.js:
Script: C:\Users\super\OneDrive\Documents\kibana\packages\kbn-babel-preset\node.js
Line: 13
Char: 9
Error: Expected identifier, string or number
Code: 800A0404
Source: Microsoft JScript compilation error
After clicking OK to dismiss this popup, here is what appears in the shell:
super#DESKTOP MINGW64 ~/OneDrive/Documents/kibana (master)
$ yarn kbn bootstrap
yarn run v1.6.0
$ node scripts/kbn bootstrap
Running [bootstrap] command from [C:\Users\super\OneDrive\Documents\kibana]:
Found [16] projects:
kibana
├── packages
│ ├── eslint-config-kibana (#elastic/eslint-config-kibana)
│ ├── eslint-plugin-kibana-custom (#elastic/eslint-plugin-kibana-custom)
│ ├── kbn-babel-preset (#kbn/babel-preset)
│ ├── kbn-datemath (#kbn/datemath)
│ ├── kbn-dev-utils (#kbn/dev-utils)
│ ├── kbn-es (#kbn/es)
│ ├── kbn-eslint-import-resolver-kibana (#kbn/eslint-import-resolver-kibana)
│ ├── kbn-eslint-plugin-license-header (#kbn/eslint-plugin-license-header)
│ ├── kbn-plugin-generator (#kbn/plugin-generator)
│ ├── kbn-plugin-helpers (#kbn/plugin-helpers)
│ ├── kbn-pm (#kbn/pm)
│ ├── kbn-system-loader (#kbn/system-loader)
│ ├── kbn-test-subj-selector (#kbn/test-subj-selector)
│ └── kbn-ui-framework (#kbn/ui-framework)
└── x-pack
Running installs in topological order:
Installing dependencies in [#kbn/babel-preset]:
[bootstrap] failed:
Error: Command failed: yarn install --non-interactive --mutex file
at makeError (C:\Users\super\OneDrive\Documents\kibana\packages\kbn-pm\dist\
index.js:38964:9)
at Promise.all.then.arr (C:\Users\super\OneDrive\Documents\kibana\packages\k
bn-pm\dist\index.js:39069:16)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The above error only occurs when I go to run yarn kbn bootstrap in the Git Bash terminal. Immediately after, I uninstalled/reinstalled Java v.8, v.10, Node.js, and Yarn with computer restarts in between, figuring that since the script host mentions JScript compilation that un-/reinstalling Java would help, but to no avail. Any advice would be greatly appreciated.
These errors seemed to have been caused by the Windows Script Host opening the .js files instead of Node.js.
Instead of installing Yarn manually from the official website, I installed it with node install -g yarn at the suggestion of a Kibana dev, and these errors finally cleared up... except for the one in the /eslint-import-resolver-kibana directory but that's not the topic of this thread. :')
Thanks again to everyone who provided support!

Categories