Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 813 Vote(s) - 3.51 Average
  • 1
  • 2
  • 3
  • 4
  • 5
800A03EA javascript syntax JScript compilaton error

#1
A very annoying compilation problem is happening to my computer regarding JScript and node, I already tried several instructions provided by the internet however the problem seems to persist.

CD>PROJECT
`npm init` ok
`npm install -g` and locally ok
`npm start` > problem with start: script > `app.js` or `node app.js` ok

If it runs I receive the Windows host server error #800A03EA syntax/compilation issue.

[![enter image description here][1]][1]

However, if I run the code
`npx http-server`, I can do my PWA projects with no issue.


I have already tried several 'fix' tools, repair, registry verification, but none of them seems to solve the situation.


[1]:
Reply

#2
JScript (interpreted by windows script host, WSH) is not the same as JavaScript (interpreted by node*).

The error mentioned sounds as if the _JScript_ interpreter of the Windows Script Host was trying to execute a _JavaScript_ file intended for node.

Make sure you run your code with node (`node app.js`) and not with WSH. The default file association in windows for *.JS is WSH so doubleclicking or just running `app.js` will run WSH.

Also make sure your `start` command in `package.json` is actually set to `node app.js`, I get the feeling it is set to just `app.js`.

```
...
"scripts": {
"start": "node app.js"
}
...
```
Then, `npm start` should work.

_*: Of course node is not the only interpreter for Javascript, but it's the one relevant here._
Reply

#3


<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Dev\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: C:\Users\Dev\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Dev\Desktop\Fetch api\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python38\Scripts\;C:\Python38\;C:\Program Files (x86)\Intel\TXE Components\iCLS\;C:\Program Files\Intel\TXE Components\iCLS\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Intel\TXE Components\DAL\;C:\Program Files (x86)\Intel\TXE Components\DAL\;C:\Program Files\Intel\TXE Components\IPT\;C:\Program Files (x86)\Intel\TXE Components\IPT\;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\dotnet\;C:\Program Files (x86)\dotnet\;C:\Users\Dev\AppData\Local\Microsoft\WindowsApps;;C:\Users\Dev\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Dev\AppData\Roaming\npm
9 verbose lifecycle [email protected]~start: CWD: C:\Users\Dev\Desktop\Fetch api
10 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'node scripts.js' ]
11 silly lifecycle [email protected]~start: Returned: code: 1 signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `node scripts.js`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Dev\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:310:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Dev\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:310:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Users\Dev\Desktop\Fetch api
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Dev\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.16.3
19 verbose npm v6.14.5
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `node scripts.js`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]


<!-- end snippet -->

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

PS C:\Users\Dev\Desktop\Fetch api> npm start

> [email protected] start C:\Users\Dev\Desktop\Fetch api
> node scripts.js

C:\Users\Dev\Desktop\Fetch api\scripts.js:1
var button = document.querySelector('.button')
^

ReferenceError: document is not defined
at Object.<anonymous> (C:\Users\Dev\Desktop\Fetch api\scripts.js:1:14)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node scripts.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\Dev\AppData\Roaming\npm-cache\_logs\2020-05-23T18_39_34_693Z-debug.log

<!-- end snippet -->

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

PACKAGE JSON

{
"name": "np",
"version": "1.0.0",
"main": "script.js",
"scripts": {
"start": "node scripts.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"npm": "^6.14.5",
"prpl-server": "^1.4.0"
},
"devDependencies": {},
"repository": {
"type": "git",
"url": "https://github.com/mendesbayout/Fetch-api-simple-forecast.git"
},
"bugs": {
"url": "https://github.com/mendesbayout/Fetch-api-simple-forecast/issues"
},
"homepage": "https://github.com/mendesbayout/Fetch-api-simple-forecast#readme",
"description": ""
}


<!-- end snippet -->




Reply

#4
Add this line at the beginning of the js file:

#!/usr/bin/env node

It will tell your system which interpreter use to run the file
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through