yeoman generated app crashes on running grunt command - npm

I am getting the following error when I run the grunt command after generating the app using Yeoman generator:
Loading "grunt-karma.js" tasks...ERROR
>> TypeError: Cannot read property 'prototype' of undefined
>> Local Npm module "grunt-node-inspector" not found. Is it installed?
Running "env:dev" (env) task
Running "sass:dist" (sass) task
Running "less:dist" (less) task
Running "jshint:all" (jshint) task
>> 86 files lint free.
Running "csslint:all" (csslint) task
>> 2 files lint free.
Running "mkdir:upload" task
Running "copy:localConfig" (copy) task
Copied 1 file
Running "concurrent:default" (concurrent) task
Loading "grunt-karma.js" tasks...ERROR
>> TypeError: Cannot read property 'prototype' of undefined
Loading "grunt-karma.js" tasks...ERROR
>> TypeError: Cannot read property 'prototype' of undefined
>> Local Npm module "grunt-node-inspector" not found. Is it installed?
>> Local Npm module "grunt-node-inspector" not found. Is it installed?
Running "nodemon:dev" (nodemon) task
Running "watch" task
Waiting...
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: server.js config/**/*.js
modules/*/server/**/*.js
[nodemon] starting `node --debug server.js`
(node:16253) [DEP0062] DeprecationWarning: `node --debug` and `node --debug-brk` are invalid. Please use `node --inspect` or `node --inspect-brk` instead.
[nodemon] app crashed - waiting for file changes before starting...
I found a similar question(Yeoman grunt could not connect to MongoDB) but I was not able to find the solution to my problem there.

Is that an old version of MEAN.js? I believe grunt was replaced by gulp and also an issue regarding node-inspector was fixed by this pull request.
You should check which version you're using and make the necessary changes.

Related

npm run serve or bulid fails on linux, but fine on Windows

Has anyone seen this error that has just started happening on my linux box? npm run serve and npm run build both run fine on my Windows machine as usual, but, as of yesterday, I get the following error on the linux box.
The code is the same (pulled from the git repo) and npm install is run before npm run serve or npm run build
Any ideas how I can track this down?...
root#agilesimulations:/usr/apps/socket-test# npm run serve
> socket-test#0.1.0 serve
> vue-cli-service serve --port 8098
INFO Starting development server...
98% after emitting CopyPlugin
ERROR Failed to compile with 1 error 3:38:16 PM
error in ./src/main.js
Syntax Error: Error: Cannot find module '#eslint/eslintrc'
# multi (webpack)-dev-server/client?http://localhost:8098&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

How to fix "Error: Watching remote files is not supported" problem in Visual Studio Code

I have Vue application that I don't run for a while and now I cannot start development server?! In meanwhile something updated and that don't work. I tried new clean vue/vuetify install and same problem!
Build for production works normally, only run development server don't work.
And important notice: when run "npm run serve" in command prompt (outside VS Code), it works normally. That not work only in VS Code Terminal. What is problem?
Node version is v10.16.0
Npm version is 6.10.3
VS Code About:
Commit: 036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8
Date: 2019-08-08T02:33:50.993Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.17763
Error (from terminal window):
> Executing task: npm run serve <
> portal#0.1.0 serve d:\Wamp64\www\portal
> vue-cli-service serve
INFO Starting development server...
10% building 2/2 modules 0 active ERROR Error: Watching remote files is not supported.
Error: Watching remote files is not supported.
at Server.setupWatchStaticFeature (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:405:13)
at Object.watchContentBase (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:477:14)
at forEach (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:550:24)
at Array.forEach (<anonymous>)
at Server.setupFeatures (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:549:49)
at new Server (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:125:10)
at serve (d:\Wamp64\www\portal\node_modules\#vue\cli-service\lib\commands\serve.js:139:20)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! portal#0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the portal#0.1.0 serve 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! C:\Users\Sasa Gosovic\AppData\Roaming\npm-cache\_logs\2019-08-11T10_35_40_418Z-debug.log
The terminal process terminated with exit code: 1
Press any key to close the terminal.
Exactly the same issue here. I resolved it by rolling back the version of webpack-dev-server.
npm install webpack-dev-server#3.7.2 --save-dev
Looks like the setupWatchStaticFeature function has changed between 3.7.2 and 3.8.0 which is triggering the issue.
You can eddit the vue.config.js file, adding following code:
devServer: {
contentBase: './public'
}
More details: https://github.com/webpack/webpack-dev-server/issues/2190#issuecomment-520670599
Until the issue is open, a workaround could be to use Git Bash instead of Windows command line to run npm run serve. I modified Server.js to output the contentBase variable. When using Windows command line or Vue UI, the variable contained "c:\...". Using Git Bash on my Windows 10 machine it contains "C:\..." and it worked.

Appium - Android - Error: spawn appium ENOENT

I am trying to run android tests with the command node ./node_modules/.bin/wdio config/wdio.android.browser.conf.js and getting the following error:
me$ node ./node_modules/.bin/wdio config/wdio.android.browser.conf.js
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn appium ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:362:16)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickDomainCallback (internal/process/next_tick.js:219:9)
at Function.Module.runMain (module.js:696:11)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
I have the following versions in my package.json:
"wdio-appium-service": "^0.2.3",
"appium": "^1.12.1",
Please let me know what other info I can provide. Thank you.
I think I figured it out... in config/wdio.android.browser.conf.js I had services: [ 'appium' ], and trying to run just appium on my machine wasn't working. I installed appium globally with npm install -g appium and that made it work. I think I can point services to the appium in the local node_modules directory and maybe it would run it from there.
If you are using windows OS, appium section in your config file shall include command: 'appium.cmd' like this :
{
services: ['appium'],
appium: {
command: 'appium.cmd',
...
}
}
This error occurs due to 2 possible issues:
1) JAVAHOME variable is not correctly set for appium to start & run tests.
-> Check that JAVAHOME is correctly set and path points to the correct file.
2) There could have been some errors during Appium installation.
-> Try reinstalling appium using npm install -g appium command and ensure that appium is installed without any errors.
Obviously, run npm install to check and install any missing dependencies too.

Running `expo start` fails with ENOENT error just after installing expo-cli on windows 10

I'm on Windows 10 Version 10.0.16299 Build 16299. I'm using Powershell. I just used yarn global add expo-cli to install expo, then I ran expo init my-app then cd my-app and expo start, but the build is failing. Here's the error image and text:
[23:11:49] Starting project at C:\projects\my-app
[23:11:58] Starting Metro Bundler on port 19001.
[23:11:58] Metro Bundler ready.
[23:12:00] Expo DevTools is running at http://localhost:19002
[23:12:00] Opening DevTools in the browser... (press shift-d to disable)
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:229:19)
at onErrorNT (internal/child_process.js:406:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Any ideas? Or even suggestions on another place where I can post this issue since it's failing out of the box. All help appreciated.
For windows:-
add environment variable in
set Path - C:\Windows\System32\
after setting path. restart your computer.
In my case, I added C:\Windows\System32\
See the Picture below:

skeleton-typescript-webpack fails when running npm start or npm run build on Windows 7

I'm running Windows 7 64bit with Node v6.5.0 and NPM 3.10.3. I ran npm install in the skeleton-typescript-webpack folder and all the packages installed fine. When I run any commands that call webpack though, I get the errors below.
When I run npm run build I get this error:
When I run npm start I get this error:
As you can see, the command that is run before the npm build error happens is concerning webpack, and same with the command that is run before the npm start error happens.
Anyone have an idea on how to fix this?
The skeleton skeleton-typescript-webpack uses TypeScript 2.0 for compilation.
This gives tries to compile adm-zip which is in the selenium-webdriver node module. And this gives an error on a break statement after a return statement.
The file .\nodes_modules\selenium-webdriver\node_modules\adm-zip\zipEntry.js gives the issue. You have to comment out two break; statements in the file on line 96 and line 115. After this you get a correct build.