Run a npm based web page on Github - javascript

I'm trying to run a web page based on npm on my Gituhb repository (paul.github.io) . In it's Readme.md we can find :
# Three.js Journey
## Setup
Download [Node.js](https://nodejs.org/en/download/).
Run this followed commands:
``` bash
# Install dependencies (only the first time)
npm install
# Run the local server at localhost:8080
npm run dev
# Build for production in the dist/ directory
npm run build
```
On my laptop (windowsĂ  I succeed on installing nodejs and npm. However, I didn't find how to install these on github. Any Idea please?

In the light of the comments, I fixed the issue by building the projet with "npm run build", and I saved the output which has been made in dist/ folder in my Github repository. Thanks again to all contributors.

Related

Configuration instructions are not clear

Here is what they say about the configuration:
Make sure you have run npm install
Build the dist directory by running BUILD_MODE=dist npm run build
Establish a link to this repository by running npm link
No problem concerning nodejs installation or linking, but the line "running BUILD_MODE=dist npm run build", I don't know how to run that, it's not a valid command... Maybe I'm just dumb, but if you can explain to me how to do that, I'd appreciate it.
Oh and I'm on Windows 10
Thanks
For Windows, you will need to run below commands.
set BUILD_MODE=dist
npm run build
npm link

Gitlab CI Failed: NPM command not found

I have been playing around Gitlabl CI but for some reason I can't get my tests to "passed". It always says npm: command not found
My Gitlab CI config looks like this:
image: node:latest
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
before_script:
- npm install
- npm install eslint -g
- npm install eslint-plugin-react -g
- npm install babel-eslint -g
test:lint:
script:
- eslint src/*
I keep getting the error below and I have No Idea why:
By the way, Im NOT using the gitlab shared runner. Not sure if that contributes to the problem but just to make sure, the machine that has my gitlab runner has all the necessary packages to run nodejs.
Your help is greatly appreciated
Best regards,
The image tag specifies a docker image, hence you must specify the executor of your runner to be docker. Did you perhaps set it to be something else, like shell, when you created the runner?
You can use like below:-
stages:
- build
- deploy
deploy-prod:
image: node:12.13.0-alpine
stage: deploy
script:
- npm i -g firebase-tools
I have same problem.
Gitlab-runner use user of 'gitlab-runner' default when it starts. So the user have not root access.
ps aux|grep gitlab-runner
copy the shell of running
change user:
run /usr/bin/gitlab-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user root in bash.
gitlab-ci runner test
pass!
kill old pid
nohup /usr/bin/gitlab-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user root
ps: gitlab-runner -u root also change user.
Your cli is taking ssh executer by default. You probably need docker. Try adding tag in your yml script.
tags: [ <your docker image name> ]
This helped me:
n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local
In my case, there are two gitlab-runner. There is no node enviroment in the specific Runner.Then I stopped the wrong one

electron js with python 3.6, print error on npm start, downgrade python?

this is my first electron js installation, and I had to download and install its electron, NPM install (in the folder electron), but when at the start, failed.
error on print, or if I had to do python downgrade?
My error screenshot:
Make sure that you are writing python3 style code. Like when you write print It should be print(...)
I had a similar problem when installing on windows. Possible solutions:
First check the versions od npm and node, update it with this commands:
curl --silent --location https://rpm.nodesource.com/setup_6.x | bash
Install again node:
sudo apt-get install nodejs
And update:
npm update -g
If it doesn't work try to update or reinstall Phyton an put it in global environment variables path.
Check the electron git and try to download the last version manually.
Other solutions:
Install or reinstall Windows .Net.
Install or reinstall Visual Basic c++
Update the package dependencies of the node

Install ReactJS without internet [duplicate]

I have a project which I will have to deploy to client Windows systems where it will not be possible to connect to internet. I currently have a folder in D:\NODE which contains node.exe and npm.cmd and a node_modules folder. To be able to run node from command line I have added D:\NODE to PATH variable.
I can have most of the modules installed locally inside node_modules of my project. However there's one - node-windows - which needs to be installed globally to work.
Following suggestion below I went to node-windows (installed globally) and packaged it up (npm pack), which created a tarball. I have then copied that file with my project and tried to install it on the test machine globally like this: npm install -g node-windows-0.1.5.tgz
I can see that it got installed in the global directory. However when I try to run the command which uses this module it complains that it cannot find it: Error: Cannot find module 'node-windows'
When I list the modules (npm list -g) it is clearly there in the list...
What do you think? And thank you.
You can install packages on a system without internet connection by packing them using built-in functionality in npm. This way, the node modules will be installed properly.
Create a package.json.
In your package.json, list all the modules you need under bundledDependencies (docs on npm).
Run npm install to install your node files before packing.
Create a tarball with npm pack.
Copy the tarball over to the machine without internet connection.
Install the modules with npm install <filename>.
Update
Regarding your comments, it looks like your globally installed node modules isn't found.
Try using the npm link command (docs on npm link):
cd yourAppFolder
npm link node-windows
1 - In system with internet access install module with this command:
npm install [module name]
2 - go to %userprofile%\AppData\Roaming\npm\node_modules[module name]\
(e.g C:\Users\janson\AppData\Roaming\npm\node_modules\grunt-cli)
3 - run npm pack
4 - this should result in a [module name]-x.y.z.tgz file
5 - run npm i -g [module name]-x.y.z.tgz in offline system

Aurelia Babel unknown option base.modules error

I downloaded the skeleton project from the Aurelia docs and tried starting it up by using the command:
gulp watch
However, I get the following error:
[09:48:13] gulp-notify: [Error running Gulp] Error: [BABEL] <filelocation>: Unknown option: base.modules
Is there a fix for this?
did you follow the full project setup instructions on the docs page or in the project's readme.md?
Running The App
To run the app, follow these steps.
Ensure that NodeJS is installed. This provides the platform on which the build tooling runs.
From the project folder, execute the following command:
npm install
Ensure that Gulp is installed globally. If you need to install it, use the following command:
npm install -g gulp
Ensure that jspm is installed globally. If you need to install it, use the following command:
npm install -g jspm
Install the client-side dependencies with jspm:
jspm install -y
To run the app, execute the following command:
gulp watch
Browse to http://localhost:9000 to see the app. You can make changes in the code found under src and the
browser should auto-refresh itself as you save files.
I read over one step, which was the npm install command which you have to execute from the project folder. I got some errors that the CL.exe file was missing and after some Googling, I found out that was due to me not having Visual Studio 2013 not installed, which kept the utf-8 validator package from not installing.

Categories