NUXT: FATAL Unexpected token export during npm run dev - vue.js

I'm fairly new to nuxt, currently developing my first site with it, and I've run into an error I can't quite figure out. My WSL Ubuntu dev environment was working just fine until I accidentally ran npm run build instead of npm run dev. Now, every time I try to run dev, I get the following:
> nuxt
FATAL Unexpected token export 15:54:51
export default {
^^^^^^
SyntaxError: Unexpected token export
at Object.compileFunction (vm.js:406:10)
at Generator.next (<anonymous>)
╭──────────────────────────────────────────╮
│ │
│ ✖ Nuxt Fatal Error │
│ │
│ SyntaxError: Unexpected token export │
│ │
╰──────────────────────────────────────────╯
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! dogabel#1.0.0 dev: `nuxt`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the dogabel#1.0.0 dev 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! /home/hughbom/.npm/_logs/2020-07-21T13_54_51_067Z-debug.log
Here is the error log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/local/bin/npm', 'run', 'dev' ]
2 info using npm#6.14.6
3 info using node#v10.19.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle dogabel#1.0.0~predev: dogabel#1.0.0
6 info lifecycle dogabel#1.0.0~dev: dogabel#1.0.0
7 verbose lifecycle dogabel#1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle dogabel#1.0.0~dev: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/hughbom/dogabel/node_modules/.bin:/home/hughbom/.vscode-server/bin/17299e413d5590b14ab0340ea477cdd86ff13daf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Python38/Scripts/:/mnt/c/Python38/:/mnt/d/Programs/bin:/mnt/d/Programs/libnvvp:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/Program Files (x86)/Razer Chroma SDK/bin:/mnt/c/Program Files/Razer Chroma SDK/bin:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Users/brad drac/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files (x86)/Calibre2/:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/NVIDIA Corporation/Nsight Compute 2019.4.0/:/mnt/c/Users/brad drac/Documents/opencv/build/x64/vc14/bin:/mnt/c/Program Files/nodejs/:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/brad drac/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/brad drac/AppData/Roaming/npm:/snap/bin
9 verbose lifecycle dogabel#1.0.0~dev: CWD: /home/hughbom/dogabel
10 silly lifecycle dogabel#1.0.0~dev: Args: [ '-c', 'nuxt' ]
11 silly lifecycle dogabel#1.0.0~dev: Returned: code: 1 signal: null
12 info lifecycle dogabel#1.0.0~dev: Failed to exec dev script
13 verbose stack Error: dogabel#1.0.0 dev: `nuxt`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid dogabel#1.0.0
15 verbose cwd /home/hughbom/dogabel
16 verbose Linux 4.19.104-microsoft-standard
17 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "run" "dev"
18 verbose node v10.19.0
19 verbose npm v6.14.6
20 error code ELIFECYCLE
21 error errno 1
22 error dogabel#1.0.0 dev: `nuxt`
22 error Exit status 1
23 error Failed at the dogabel#1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
And here is my nuxt.config.js
export default {
/* Show nuxt debug logs */
dev: (process.env.DEBUG = 'nuxt:*'),
/*
** Nuxt rendering mode
** See https://nuxtjs.org/api/configuration-mode
*/
mode: 'universal',
/*
** Nuxt target
** See https://nuxtjs.org/api/configuration-target
*/
target: 'static',
/*
** Headers of the page
** See https://nuxtjs.org/api/configuration-head
*/
head: {
title: process.env.npm_package_name || '',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
hid: 'description',
name: 'description',
content: process.env.npm_package_description || '',
},
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
/*
** Global CSS
*/
css: [
{ src: '#/css/main.scss', lang: 'scss' },
{ src: 'font-awesome/scss/font-awesome.scss', lang: 'scss' }
],
/*
** Plugins to load before mounting the App
** https://nuxtjs.org/guide/plugins
*/
plugins: [],
/*
** Auto import components
** See https://nuxtjs.org/api/configuration-components
*/
components: true,
/*
** Nuxt.js dev-modules
*/
buildModules: ['#nuxt/typescript-build', 'nuxt-purgecss'],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://github.com/nuxt/content
'#nuxt/content',
],
/*
** Content module configuration
** See https://content.nuxtjs.org/configuration
*/
content: {},
/*
** Build configuration
** See https://nuxtjs.org/api/configuration-build/
*/
build: {},
}
I have no idea what the problem is from the error message and logs(perhaps I need to transpile something?), so any help would be appreciated.

export statement will not work at nuxt.config.js
change export default to 'module.exports ='
module.exports = {
// nuxt config
};

Related

Cannot read property 'run' of undefined (awesome-typescript-loader)

I'm attempting to update our angular 5 application to angular 6, and am running into a build issue currently with awesome-typescript loader.
The full error message is
C:\source\ProjectFolder\Angular.Web.App\node_modules\awesome-typescript-loader\src\watch-mode.ts:5
compiler.hooks.run.tapAsync('at-loader', function(params, callback) {
^
TypeError: Cannot read property 'run' of undefined
at CheckerPlugin.apply (C:\source\ProjectFolder\Angular.Web.App\node_modules\awesome-typescript-loader\src\watch-mode.ts:5:18)
at Compiler.apply (C:\source\ProjectFolder\Angular.Web.App\node_modules\tapable\lib\Tapable.js:375:16)
at webpack (C:\source\ProjectFolder\Angular.Web.App\node_modules\webpack\lib\webpack.js:33:19)
at options.map.options (C:\source\ProjectFolder\Angular.Web.App\node_modules\webpack\lib\webpack.js:23:55)
at Array.map (<anonymous>)
at webpack (C:\source\ProjectFolder\Angular.Web.App\node_modules\webpack\lib\webpack.js:23:40)
at processOptions (C:\source\ProjectFolder\Angular.Web.App\node_modules\webpack\bin\webpack.js:335:15)
at yargs.parse (C:\source\ProjectFolder\Angular.Web.App\node_modules\webpack\bin\webpack.js:397:2)
at Object.Yargs.self.parse (C:\source\ProjectFolder\Angular.Web.App\node_modules\webpack\node_modules\yargs\yargs.js:533:18)
at Object.<anonymous> (C:\source\ProjectFolder\Angular.Web.App\node_modules\webpack\bin\webpack.js:152:7)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Angular.Web.App#1.0.0-rc3 build:webpack: `webpack --progress --color`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Angular.Web.App#1.0.0-rc3 build:webpack 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\UserAccount\AppData\Roaming\npm-cache\_logs\2019-06-20T21_07_09_890Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Angular.Web.App#1.0.0-rc3 build:dev: `npm run build:vendor && npm run build:webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Angular.Web.App#1.0.0-rc3 build:dev 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\UserAccount\AppData\Roaming\npm-cache\_logs\2019-06-20T21_07_09_936Z-debug.log
it is required, as our webpack is pulling in its CheckerPlugin
const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin;
module.exports = (env) => {
// Configuration in common to both client-side and server-side bundles
const isDevBuild = !(env && env.prod);
const sharedConfig = {
stats: { modules: false },
context: __dirname,
resolve: { extensions: [ '.js', '.ts' ] },
output: {
filename: '[name].js',
publicPath: 'dist/' // Webpack dev middleware, if enabled, handles requests for this URL prefix
},
module: {
rules: [
{ test: /\.ts$/, use: isDevBuild ? ['angular2-template-loader', 'angular2-router-loader'] : '#ngtools/webpack' },
{ test: /\.html$/, use: 'html-loader?minimize=false' },
{ test: /\.css$/, use: [ 'to-string-loader', isDevBuild ? 'css-loader' : 'css-loader?minimize' ] },
{ test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' },
...sharedModuleRules
]
},
plugins: [new CheckerPlugin()]
};
currenlty using awesome-typescript-loader v. 5.0.0

Courgette - issue with running test

I'm trying to use Courgette to test an Angular web app. This is my first time so I started with a tutorial from here:
The thing is that I can't run even the built in test. this is my conf.js:
const path = require('path');
require('babel-core/register');
const specsPath = 'uiTests';
const outputPath = 'uiTestResult';
const cukeTractorPath = 'node_modules/cucumber-protractor/uiTestHelpers';
exports.pomConfig = {
outputPath,
timeoutInSeconds: 10,
pagesPath: path.resolve(specsPath, 'pages'),
componentsPath: path.resolve(specsPath, 'components'),
baseUrl: 'https://www.google.com/', // <------------ SET THE URL TO YOUR PROJECT HERE
};
exports.cucumberHtmlReporterConfig = {};
const cukeTags = process.env.cukeTags ? process.env.cukeTags.replace(',', ' or ') : '';
const protractorConfig = {
directConnect: true,
ignoreUncaughtExceptions: true,
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
specs: [
`${specsPath}/features/**/*.feature`,
],
capabilities: {
// acceptInsecureCerts: true, // uncomment to ignore SSL warnings
'shardTestFiles': !cukeTags && !process.env.linearise && !process.env.showStepDefinitionUsage,
'maxInstances': 4,
browserName: 'chrome',
chromeOptions: {
args: ['--window-size=1100,800'].concat(process.env.disableHeadless ? [] : ['--headless', '--disable-gpu']),
},
// 'browserName': 'firefox',
// 'moz:firefoxOptions': {
// args: [].concat(process.env.disableHeadless ? [] : ['-headless']),
// prefs: {
// 'general.useragent.override': 'Automated tests',
// },
// },
},
cucumberOpts: {
'require': [
// `${specsPath}/helpers/globals.js`,
`${cukeTractorPath}/globals.js`,
`${cukeTractorPath}/hooks/attachScenarioNameBefore.js`,
`${cukeTractorPath}/hooks/attachScreenshotAfter.js`,
`${cukeTractorPath}/hooks/pageObjectModelBefore.js`,
`${cukeTractorPath}/hooks/addMethodsBefore.js`,
`${cukeTractorPath}/hooks/setDefaultTimeout.js`,
`${cukeTractorPath}/stepDefinitions/*.js`,
`${specsPath}/stepDefinitions/*.js`,
// `${specsPath}/helpers/hooks.js`,
],
'tags': ['~ignore'].concat(cukeTags || []),
'format': [
'node_modules/cucumber-protractor/cucumberFormatter.js',
`json:./${outputPath}/report.json`,
].concat(process.env.showStepDefinitionUsage ? 'node_modules/cucumber/lib/formatter/usage_formatter.js' : []),
'profile': false,
'no-source': true,
},
onPrepare: () => { browser.ignoreSynchronization = true; },
};
exports.config = protractorConfig;
And this is the message from the terminal:
> c10#1.0.0 ct C:\Users\Melinda\Desktop\Protractor\c10
> set NODE_OPTIONS=--no-deprecation | cuketractor
Brm brm... off we go!
[09:04:34] I/launcher - Running 1 instances of WebDriver
[09:04:34] I/direct - Using ChromeDriver directly...
DevTools listening on ws://127.0.0.1:12249/devtools/browser/748be31e-7dd6-4f56-95d5-eba8122e4012
Test feature::: Clicking I’m Feeling Lucky without typing a search query goes straight to doodles
Getting full url: https://www.google.com/
Given I am on the 'Google Home' page ---> PASSED
[09:04:38] W/element - more than one element found for locator By(css selector, [name="btnI"]) - the first result will be used
When I click 'I’m Feeling Lucky' ---> FAILED
Then I expect the url to contain 'google.com/doodles' ---> SKIPPED
Screenshot of: Clicking I’m Feeling Lucky without typing a search query goes straight to doodles
*************************************
ScreenshotFilePath:
uiTestResult\Clicking-I’m-Feeling-Lucky-without-typing-a-search-query-goes-straight-to-doodles-1558944278600.png
*************************************
-------------------------------------
---FAIL---
[09:04:38] I/launcher - 0 instance(s) of WebDriver still running
[09:04:38] I/launcher - chrome #01 failed 1 test(s)
[09:04:38] I/launcher - overall: 1 failed spec(s)
[09:04:38] E/launcher - Process exited with error code 1
Cucumber HTML report C:\Users\Melinda\Desktop\Protractor\c10\uiTestResult\cucumberReport.html generated successfully.
------------------ Scenario Error --------------- Clicking I’m Feeling Lucky without typing a search query goes straight
to doodles
Tags: #google, #google-feeling-lucky
Step: When I click 'I’m Feeling Lucky'
Location: node_modules\cucumber-protractor\uiTestHelpers\stepDefinitions\commonWhenSteps.js:46
Feature: uiTests\features\google.feature:4
Error message: ElementNotVisibleError: element not visible
(Session info: headless chrome=74.0.3729.169)
(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 10.0.17134 x86_64)
at Object.checkLegacyResponse (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\http.js:441:30)
at process._tickCallback (internal/process/next_tick.js:68:7)
From: Task: WebElement.click()
at Driver.schedule (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\webdriver.js:807:17)
at WebElement.schedule_ (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\webdriver.js:2010:25)
at WebElement.click (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\webdriver.js:2092:17)
at actionFn (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\protractor\built\element.js:89:44)
at Array.map (<anonymous>)
at actionResults.getWebElements.then (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\protractor\built\element.js:461:65)
at ManagedPromise.invokeCallback_ (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\promise.js:1376:14)
at TaskQueue.execute_ (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\promise.js:3084:14)
at TaskQueue.executeNext_ (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\promise.js:3067:27)
at asyncRun (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\promise.js:2927:27)
at C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\promise.js:668:7
at process._tickCallback (internal/process/next_tick.js:68:7)Error
at ElementArrayFinder.applyAction_ (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\protractor\built\element.js:459:27)
at ElementArrayFinder.(anonymous function).args [as click] (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\protractor\built\element.js:91:29)
at ElementFinder.(anonymous function).args [as click] (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\protractor\built\element.js:831:22)
-----SCREENSHOT - hold cmd (on mac) and click .png below if using iterm ----
ScreenshotFilePath: uiTestResult\Clicking-I’m-Feeling-Lucky-without-typing-a-search-query-goes-straight-to-doodles-1558944278600.png
---------
┌─────────────────┬────────────┬──────────┐
│ Total Scenarios │ Successful │ Failures │
├─────────────────┼────────────┼──────────┤
│ 1 │ 0 │ 1 │
└─────────────────┴────────────┴──────────┘
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! c10#1.0.0 ct: `set NODE_OPTIONS=--no-deprecation | cuketractor`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the c10#1.0.0 ct 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\Melinda\AppData\Roaming\npm-cache\_logs\2019-05-27T08_04_38_705Z-debug.log
And my log file:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Melinda\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'ct' ]
2 info using npm#6.9.0
3 info using node#v10.15.3
4 verbose run-script [ 'prect', 'ct', 'postct' ]
5 info lifecycle c10#1.0.0~prect: c10#1.0.0
6 info lifecycle c10#1.0.0~ct: c10#1.0.0
7 verbose lifecycle c10#1.0.0~ct: unsafe-perm in lifecycle true
8 verbose lifecycle c10#1.0.0~ct: PATH: C:\Users\Melinda\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Melinda\Desktop\Protractor\c10\node_modules\.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Melinda\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Taurus\bin;C:\Program Files\Taurus\bin;C:\Program Files\Java\jdk-10.0.2\bin;C:\Program Files\Java\jre-10.0.2\bin;C:\Users\Melinda\Downloads\apache-jmeter-4.0\apache-jmeter-4.0\bin;C:\Users\Melinda\AppData\Local\Taurus\bin;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Melinda\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Melinda\AppData\Roaming\npm
9 verbose lifecycle c10#1.0.0~ct: CWD: C:\Users\Melinda\Desktop\Protractor\c10
10 silly lifecycle c10#1.0.0~ct: Args: [ '/d /s /c',
10 silly lifecycle 'set NODE_OPTIONS=--no-deprecation | cuketractor' ]
11 silly lifecycle c10#1.0.0~ct: Returned: code: 1 signal: null
12 info lifecycle c10#1.0.0~ct: Failed to exec ct script
13 verbose stack Error: c10#1.0.0 ct: `set NODE_OPTIONS=--no-deprecation | cuketractor`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Melinda\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Melinda\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid c10#1.0.0
15 verbose cwd C:\Users\Melinda\Desktop\Protractor\c10
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Melinda\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "ct"
18 verbose node v10.15.3
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error c10#1.0.0 ct: `set NODE_OPTIONS=--no-deprecation | cuketractor`
22 error Exit status 1
23 error Failed at the c10#1.0.0 ct script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I'm not even sure where the problem is. According to the error message the element in my 'When' section can't be found but chrome doesn't even open up in the first place.
Can anyone help with this?
It could either be that the sample was broken at the time or that your locale is different to en-gb and the text is wrong in the button. Isn't the most reliable of samples, needs to be changed to something more stable ideally, something hosted by courgette.

Unable to start webpack-dev-server

I am attempting to do a React tutorial, and although I have downloaded files from the instructor, I am unable to start the web-dev-server on my laptop. I can, however, get it to work on my desktop computer. I will need to be able to work on my laptop, though, so I would appreciate any help in figuring out what's wrong. I have tried deleting and re-installing the the node_modules folder (many times), as well as deleting just the webpack-dev-server folder and re-installing that. As far as I can tell no other program is using the same port (8080).
Here is the error log I get:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm#6.4.0
3 info using node#v8.11.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle github-battle#1.0.0~prestart: github-battle#1.0.0
6 info lifecycle github-battle#1.0.0~start: github-battle#1.0.0
7 verbose lifecycle github-battle#1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle github-battle#1.0.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/eleerogers/Downloads/react-fundamentals-first-component/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle github-battle#1.0.0~start: CWD: /Users/eleerogers/Downloads/react-fundamentals-first-component
10 silly lifecycle github-battle#1.0.0~start: Args: [ '-c', 'webpack-dev-server --open' ]
11 silly lifecycle github-battle#1.0.0~start: Returned: code: 1 signal: null
12 info lifecycle github-battle#1.0.0~start: Failed to exec start script
13 verbose stack Error: github-battle#1.0.0 start: `webpack-dev-server --open`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid github-battle#1.0.0
15 verbose cwd /Users/eleerogers/Downloads/react-fundamentals-first-component
16 verbose Darwin 17.7.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
18 verbose node v8.11.3
19 verbose npm v6.4.0
20 error code ELIFECYCLE
21 error errno 1
22 error github-battle#1.0.0 start: `webpack-dev-server --open`
22 error Exit status 1
23 error Failed at the github-battle#1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Here is the webpack.config.js:
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './app/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index_bundle.js'
},
module: {
rules: [
{ test: /\.(js)$/, use: 'babel-loader' },
{ test: /\.css$/, use: [ 'style-loader', 'css-loader' ]}
]
},
plugins: [
new HtmlWebpackPlugin({
template: 'app/index.html'
})
],
mode: "development"
};
And here is the package.json:
{
"name": "github-battle",
"version": "1.0.0",
"description": "Project for TylerMcGinnis.com's fundamental course.",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --open"
},
"author": "Tyler McGinnis",
"license": "MIT",
"babel": {
"presets": [
"env",
"react"
]
},
"dependencies": {
"react": "^16.0.0-alpha.5",
"react-dom": "^16.0.0-alpha.5"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.11",
"html-webpack-plugin": "^3.2.0",
"style-loader": "^0.21.0",
"webpack": "^4.8.3",
"webpack-cli": "^2.1.4",
"webpack-dev-server": "^3.1.5"
}
}
Although, as I said, it works on my desktop, so I don't think it's anything wrong with those... something is going on with my laptop. It is a new Macbook Air. Thanks for any help!
npm clean cache
then
npm install
This should solve your problem.

npm run serve/yarn serve is not working upon restarting('node' is not recognized as an internal or external command, operable program or batch file.)

It used to work but when I restarted my PC it won't work anymore. The nodejs directory is set in the Path environmental variable. I tried reinstalling nodejs. I also tried uninstalling #vue folder, running my git bash as administrator, and opening and reopening the terminal. Nothing is currently working. How can I fix this?
Error
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Mariel\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'serve' ]
2 info using npm#6.0.0
3 info using node#v10.0.0
4 verbose run-script [ 'preserve', 'serve', 'postserve' ]
5 info lifecycle vue-proj#0.1.0~preserve: vue-proj#0.1.0
6 info lifecycle vue-proj#0.1.0~serve: vue-proj#0.1.0
7 verbose lifecycle vue-proj#0.1.0~serve: unsafe-perm in lifecycle true
8 verbose lifecycle vue-proj#0.1.0~serve: PATH: C:\Users\Mariel\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Mariel\Code\vue-proj\node_modules\.bin;C:\Users\Mariel\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Mariel\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Sony\VAIO Improvement;C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\Skype\Phone;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\Git\cmd;.;C:\xampp\php";C:\xampp\php;C:\ProgramData\ComposerSetup\bin;C:\Program Files\nodejs;C:\Users\Mariel\AppData\Local\Microsoft\WindowsApps;C:\Users\Mariel\AppData\Roaming\Composer\vendor\bin;C:\Program Files\nodej;C:\Users\Mariel\AppData\Roaming\npm;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle vue-proj#0.1.0~serve: CWD: C:\Users\Mariel\Code\vue-proj
10 silly lifecycle vue-proj#0.1.0~serve: Args: [ '/d /s /c', 'vue-cli-service serve' ]
11 silly lifecycle vue-proj#0.1.0~serve: Returned: code: 1 signal: null
12 info lifecycle vue-proj#0.1.0~serve: Failed to exec serve script
13 verbose stack Error: vue-proj#0.1.0 serve: `vue-cli-service serve`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Mariel\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:283:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Mariel\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:947:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5)
14 verbose pkgid vue-proj#0.1.0
15 verbose cwd C:\Users\Mariel\Code\vue-proj
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Mariel\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "serve"
18 verbose node v10.0.0
19 verbose npm v6.0.0
20 error code ELIFECYCLE
21 error errno 1
22 error vue-proj#0.1.0 serve: `vue-cli-service serve`
22 error Exit status 1
23 error Failed at the vue-proj#0.1.0 serve script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Dependencise(package.json)
{
"name": "vue-proj",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"vue": "^2.5.16"
},
"devDependencies": {
"#vue/cli-plugin-babel": "^3.0.0-beta.9",
"#vue/cli-plugin-eslint": "^3.0.0-beta.9",
"#vue/cli-service": "^3.0.0-beta.9",
"vue-template-compiler": "^2.5.13"
},
"babel": {
"presets": [
"#vue/app"
]
},
"eslintConfig": {
"root": true,
"extends": [
"plugin:vue/essential",
"eslint:recommended"
]
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
re-install the npm package manager
or update node to LTS Version

Project won't start after installation

Installed create-react-native-app and used it to create my application.
Everything worked fine until i've installed react-navigation like in tutorial npm install --save react-navigation
My project won't even start. I haven't made any changes in it. I just installed this package.
package.json
{
"name": "EliteEl",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-native-scripts": "1.10.0",
"jest-expo": "25.0.0",
"react-test-renderer": "16.2.0"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^25.0.0",
"react": "16.2.0",
"react-native": "0.52.0",
"react-navigation": "^1.0.0-beta.27"
}
}
Error log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm#5.5.1
3 info using node#v9.2.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle EliteEl#0.1.0~prestart: EliteEl#0.1.0
6 info lifecycle EliteEl#0.1.0~start: EliteEl#0.1.0
7 verbose lifecycle EliteEl#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle EliteEl#0.1.0~start: PATH: C:\Program
Files\nodejs\node_modules\npm\bin\node-gyp-bin;E:\xampp\htdocs\lessons\REACT\EliteEl\node_modules\.bin;E:\Soft\Embarcadero\Studio\19.0\bin;C:\Users\Public\Documents\Embarcadero\Studio\19.0\Bpl;E:\Soft\Embarcadero\Studio\19.0\bin64;C:\Users\Public\Documents\Embarcadero\Studio\19.0\Bpl\Win64;E:\Soft\cuda\soft\bin;E:\Soft\cuda\soft\libnvvp;C:\ProgramData\Oracle\Java\javapath;E:\Soft\Anaconda3;E:\Soft\Anaconda3\Library\mingw-w64\bin;E:\Soft\Anaconda3\Library\usr\bin;E:\Soft\Anaconda3\Library\bin;E:\Soft\Anaconda3\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;E:\xampp\php;C:\ProgramData\ComposerSetup\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\nodejs\;C:\Program Files\PuTTY\;C:\Go\bin;C:\Program Files (x86)\Yarn\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\Java\jdk1.8.0_152\bin;C:\Program Files\Git\cmd;C:\Users\ykemer.SPA\AppData\Roaming\Composer\vendor\bin;C:\Users\ykemer.SPA\AppData\Roaming\npm;C:\Users\ykemer.SPA\AppData\Local\Yarn\bin
9 verbose lifecycle EliteEl#0.1.0~start: CWD: E:\xampp\htdocs\lessons\REACT\EliteEl
10 silly lifecycle EliteEl#0.1.0~start: Args: [ '/d /s /c', 'react-native-scripts start' ]
11 silly lifecycle EliteEl#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle EliteEl#0.1.0~start: Failed to exec start script
13 verbose stack Error: EliteEl#0.1.0 start: `react-native-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:280:16)
13 verbose stack at EventEmitter.emit (events.js:159:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:159:13)
13 verbose stack at maybeClose (internal/child_process.js:943:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid EliteEl#0.1.0
15 verbose cwd E:\xampp\htdocs\lessons\REACT\EliteEl
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v9.2.0
19 verbose npm v5.5.1
20 error code ELIFECYCLE
21 error errno 1
22 error EliteEl#0.1.0 start: `react-native-scripts start`
22 error Exit status 1
23 error Failed at the EliteEl#0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Error in console
Error: React native is not installed. Please run `npm install` in your project directory.
16:36:47: Error starting packager: Error: Couldn't start project. Please fix the errors and restart the project.
at C:\xdl\src\Project.js:1291:11
at Generator.next (<anonymous>)
at step (C:\Users\ykemer.SPA\AppData\Roaming\npm\node_modules\react-native-scripts\node_modules\xdl\build\Project.js:1679:191)
at C:\Users\ykemer.SPA\AppData\Roaming\npm\node_modules\react-native-scripts\node_modules\xdl\build\Project.js:1679:361
at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! EliteEl#0.1.0 start: `react-native-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the EliteEl#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! C:\Users\ykemer.SPA\AppData\Roaming\npm-cache\_logs\2018-01-24T12_36_47_683Z-debug.log
I don't know why, but it doesn't accept globally installed package.
So i had to run npm install and then everything was good