How can I target the .js HelloWorld File I made with Node.js? [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am working through "NodeBeginner.org".
With extremely little command line experience I'm failing to run my first file.
I've managed to run "console.log('helloworld');" from the console by entering in JUST that line.
If it looks like I need to learn a more about CLI, then please point me in a direction for what concepts are important for node.js

You should type node helloworld.js in command line, not in Node interactive shell.
In interactive shell, you can execute JS statement directly like input console.log('Hello world')

It looks like you are trying to run your file from inside the node CPI shell.
Use Ctrl+C to exit the node CLI shell.
Then use the following command inside your projects working directory:
node helloworld.js

Related

How should I initialize "npm" package in Notepad++? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 months ago.
Improve this question
I can't initialize the npm package in Notepad++. I don't know how to do it, because in every video the Youtubers initialize them with the program's terminal, but I think Notepad++ doesn't have a terminal or if it does I can't find it. Can anyone help me please, cause I can't finish my Login system if I don't have that package? Or should I use another program for example Visual Studio? What's the best HTML development program?
Open Terminal or Command Prompt if you are using windows.
go to the folder where your project is using cd command.
Install npm's you need.
The terminal in any code editor is same as operating system terminal.
I will suggest to use VS Code for learning as most tutorials will be using that.

Slow build react project [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have created React apps.when I try to build react project using "npm run build" command from terminal,it takes more than 15 minutes to build project.Can any one advise what is the actual problem of this ???
It creates build for production, so it invoke some optimizations
If you want build your app faster you can build with development enviroment without optimizations
For this you can change mode parameter on mode: 'development' in your webpack config

React : Change in node_modules file does not reflect the change in UI [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
Maybe I am doing it wrong. I want to do changes in node_modules folder. Now when I run npm run watch or npm run dev it doesn't get reflected in UI.
Any idea what is wrong?
Try editing from the /dist folder of the library you are trying to edit. Your changes will not reflect if you edit from the source and not from the output bundles.
Note: If you are just logging a result (via console.log) that is fine, but as much as possible, do not edit from the node_modules folder.

NodeJS - Typescript - Intellisense [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
In VS2013, intelliSense in a NodeJS App in a *.js file works like a charm. I was wondering if there is also intelliSense supported in a TypeScript file for several NodeJS-Modules? How can I enable intelliSense for NodeJS in a TypeScript file?
DefinitelyTyped is the place to look for typescript definition files:
https://github.com/borisyankov/DefinitelyTyped/tree/master/node
You can use your favorite package manager to get it and all of the DefinitelyTyped deffinitions are available in NuGet.
There are a quite a few specific NPM modules on there too, but some you will have to define yourself.
In VS2013 when you add a deffinition file (*.d.ts) then it will be available from the IntelliSense.

Node.js Only Displays " ... " when i try and execute files [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Ok Whenever I use Node.js, I can execute inline code like: console.log('Hello World'); , Perfectly but, when i try and use: node test/test.js or node test.js, It looks like this:
>node test/test.js
...
And thats all I get!!! I could never get it to work. I would appreciate it tremendously, thank you all.
I suspect that you started node by running the executable itself. In this mode you can run the javascript commands directly. But people usually running node scripts from the terminal (Linux/Mac) or command prompt (Windows) as follows:
C:\>node test/test.js
Where C:\ is a path to the current working folder.

Categories