I followed the NativeScript installation guide here:
https://docs.nativescript.org/angular/start/quick-setup
I finished all 3 steps, but when I ran "tns doctor" at the end, I got these issues:
Support for Node.js ^4.0.0 is deprecated and will be removed in the next release of NativeScript. Please, upgrade to the latest Node.js LTS version.
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Yok.resolveDependency (C:\Program Files (x86)\Nodist\bin\node_modules\nativescript\lib\common\yok.js:338:13)
at Yok.resolveByName (C:\Program Files (x86)\Nodist\bin\node_modules\nativescript\lib\common\yok.js:315:31)
at Yok.resolve (C:\Program Files (x86)\Nodist\bin\node_modules\nativescript\lib\common\yok.js:262:25)
Error while reporting exception: SyntaxError: Unexpected token {
When I tried to resolve the first issue, I ran "nodist -v" and it told me I'm on version 0.8.8. So I ran "nodist use 8" and then "nodist list" and I'm on 8.11.1. So when I run "nodist -v" again, I expect it to say 8.11.1 but it spits out 0.8.8 again.
I checked the error files listed in the syntax error and they are syntactically correct.
How do I resolve these issues?
The Nodist library looks abandoned and I'm not sure what might be the reason to interfere with NativeScript. We certainly haven't tested it.
My suggestion would be to remove it from your system and ensure that you have Node.JS LTS properly installed. If you need to work with multiple version of Node on your system, I recommend you to try nvm - we don't have known issues when using NativeScript with nvm.
Related
I'm setting up a new mac dev machine, and have gotten node, npm, and nvm installed. All seems fine within a single project directory. However, when trying to install and use fastify-cli, I'm receiving an error:
internal/modules/cjs/loader.js:892
throw err;
^
Error: Cannot find module 'node:process'
Require stack:
- /Users/a/.nvm/versions/node/v14.17.5/lib/node_modules/fastify-cli/node_modules/marked-terminal/index.cjs
- /Users/a/.nvm/versions/node/v14.17.5/lib/node_modules/fastify-cli/node_modules/blessed-contrib/lib/widget/markdown.js
- /Users/a/.nvm/versions/node/v14.17.5/lib/node_modules/fastify-cli/node_modules/blessed-contrib/index.js
- /Users/a/.nvm/versions/node/v14.17.5/lib/node_modules/fastify-cli/docs.js
- /Users/a/.nvm/versions/node/v14.17.5/lib/node_modules/fastify-cli/cli.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (/Users/a/.nvm/versions/node/v14.17.5/lib/node_modules/fastify-cli/node_modules/marked-terminal/index.cjs:3:17)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/a/.nvm/versions/node/v14.17.5/lib/node_modules/fastify-cli/node_modules/marked-terminal/index.cjs',
'/Users/a/.nvm/versions/node/v14.17.5/lib/node_modules/fastify-cli/node_modules/blessed-contrib/lib/widget/markdown.js',
'/Users/a/.nvm/versions/node/v14.17.5/lib/node_modules/fastify-cli/node_modules/blessed-contrib/index.js',
'/Users/a/.nvm/versions/node/v14.17.5/lib/node_modules/fastify-cli/docs.js',
'/Users/a/.nvm/versions/node/v14.17.5/lib/node_modules/fastify-cli/cli.js'
]
}
Steps to reproduce:
$ npm install --global fastify-cli (succeeds)
$ fastify generate myproject (also produces above error)
$ fastify (also produces above error)
This likely doesn't have much to do with fastify. It seems to me that the global package is not finding Node for some reason, but I may be wrong.
I'm using zshell
I've got xcode installed
I've upgraded the version of node i'm using
I'm able to start a fastify app from the app directory directly/without using the generator
Any thoughts?
I fixed the error following the answer in this GitHub issue reply
node internal syntax (e.g.: node:<core_module_name>) is not supported by Node.js 14.16.0
The CLI needs node version >= 14.19
Steps:
Upgrade node using nvm to 14.9.0 (the last lts in 14.x).
Set default version 14.9.0 or above.
you need to run
npm i #types/node
I solved it by switching the current user to a root user.
If you are using a Mac, try to switch to a root user account and do the same thing again.
I assigned my previous account as 'administrator' under system preferences, but this won't solve the issue. The problem was perfectly solved when I switched to my primary account.
Hope this could help!
Good, I apologize for the inconvenience, I would like to know if this has happened to someone, I am trying to run a bot in Ubuntu 18, but it does not start, I already installed everything as in Windows but for Ubuntu clearly.
In windows, the same bot works, but when I try to start it in Ubuntu, it throws me this error, I have already installed a thousand things on the machine that literally nothing to do with it.
If someone could help me or allow me where to read, I would be infinitely grateful.
root#ns533280:/home/Discord/Test# node index.js
module.js:487
throw err;
^
Error: Cannot find module 'node:events'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous>
(/home/Discord/Test/node_modules/discord.js/src/client/BaseClient.js:3:22)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
root#ns533280:/home/Discord/Test# node -v
v8.0.0
root#ns533280:/home/Discord/Test# npm -v
5.0.0
How To Solve Error: Cannot find module 'node:events' Error?
To Solve Error:-
Cannot find module 'node:events' Error Minimum required nodejs version is v16.6 in order to use discord.js. So You just need to update nodejs to v16.6. And Your error will be solved.
You use too old version of node.js. According to this doc node 16.6.0 required. Just update your node.js version by install new or by nvm(for manage different node.js version on your PC).
I am trying to get CKEditor in my project with a custom build.
However, my problem is more general, so feel free to answer even if you don't use CKEditor.
Following the instructions to generate a custom build, I am getting a syntax error when running npm run build in terminal:
my/build/path/bin/create-entry-file.js:12
const { bundler } = require('#ckeditor/ckeditor5-dev-utils');
^
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:140:18)
at node.js:1043:3
Npm fails with a bunch of text and the above error. I believe this error is generated due to modern ECMAScript syntax, which is not recognized in my local machine.
However, the build I am trying to generate is there, complete and ready. Also, some other documentation of theirs, indicate more import {...} from syntax. This means that they are able to generate the build without the need of external packages (otherwise they would be in the package.json dependencies).
So, my question is, how do I install the software needed that will allow my npm to recognize and execute modern ES syntax ?
I am running on Ubuntu 16, with the lastest npm version: 5.6.0.
Thanks in advance, let me know if I can provide more information
Can you please check the version of Node on your computer?
Run in the terminal
node -v
You need to have at least 6.4 as your Node.js version according to this list on your computer
Here you have a link where you get and update to the newest version of Node 8.9.4 for different platforms. In your case check Linux
https://nodejs.org/en/download/
my open-source project depends on a lemmatization module —
https://github.com/grachev/node-lemmer
— which needs to be compiled before it can run.
After updating to a newer version of node.js I can't run this module, because it needs to be re-compiled. Usually this was done when I simply did npm install node-lemmer however it is now not available in npm and I don't know how to compile it under that new node version and why I have to do it at all...
I tried running npm rebuild but it does not recompile – too many errors. The issues folder of that project on GitHub has the issue up already but there's no fix for it...
What could I do about it? Why do I need to recompile this module when I install a new version of node? Is there a workaround? Could I "trick" node or that module so it doesn't need to recompile? Or maybe it's possible to compile it manually?
...
Some mode details:
I used to run my project on node 0.8.3 vesion and then switched to the new 8.8.0 version. Now when I try to run my project under the new node version it doesn't start giving the following error:
module.js:641
return process.dlopen(module, path._makeLong(filename));
^
Error: Module did not self-register.
at Object.Module._extensions..node (module.js:641:18)
at Module.load (module.js:531:32)
at tryModuleLoad (module.js:494:12)
at Function.Module._load (module.js:486:3)
at Module.require (module.js:556:17)
at require (internal/module.js:11:18)
at Object.<anonymous>
(/path-to-my-project/node_modules/node-lemmer/lib/node-lemmer.js:1:82)
at Module._compile (module.js:612:30)
at Object.Module._extensions..js (module.js:623:10)
at Module.load (module.js:531:32)
which is an error I've seen before because my module could not be compiled.
my project is https://github.com/noduslabs/infranodus in case it helps to see the source code.
I'm new to Node.js. I have node 0.9.5-pre running on Linux Mint. I used npm (1.1.70) to install TypeScript but now I get the following error when I run tsc:
Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.
at Function.Object.defineProperty.get (module.js:386:11)
at Object.<anonymous> (/home/rolyp/bin/tsc#0.8.0:4:21)
at Module._compile (module.js:454:26)
at Object.Module._extensions..js (module.js:472:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:497:10)
at process._tickCallback (node.js:334:13)
I gather that require.paths is not supported in recent versions of Node. There seem to be several relevant existing questions, but I don't understand the problem well enough to make use of the answers.
I tried deleting ~/.node_modules, but that didn't help.
Could someone please explain the problem and point me to a solution?
thanks
I have node 0.9.5-pre
Was a bug in the beta release that was fixed when 0.9 official came out