Can't build the angular 2 github project - angularjs

I have forked the angular 2 github repo, clone it in my desktop, add upstream then run npm install, but when I want to build ($(npm bin)/gulp build) i have an error message:
"Task 'build' is not in your gulpfile"
How can I properly build the project?

Try gulp build.sh for more recent versions. You can also run simply ./build.sh from the base directory. For future reference you can see a list of gulp tasks using gulp -T.
Make sure you're using the correct version of node (use nvm if you need to) as described in the developer guide.

Related

No `package.json` file found. Make sure you are running the command in a Node.js project

I am building a AngularJS file with typescript and installed tsd for typedefinitions globally. When I try to run the following command on the root of my project folder I am getting an error
I am new Angular JS using version 1.7. I am not sure if Package.json is needed for AngularJS project
Command
tsd install angular --resolve --save
Error
No package.json file found. Make sure you are running the command in a Node.js project.
package.json is required for node projects to specify metadata about project and include some important commands that may be required for the project build. First you have to install node from official website. You can google for the step by step installation. Once installed, goto your project directory and run this command. Make sure to perform "npm init" before you run the desired angular command.
Note: Ensure, node is accessible through cli
tsd is deprecated use #types node modules
npm i #types/angular --save

For react-admin-demo is it compulsory to do complete build of react-admin

For react-admin-demo is it compulsory to do complete build of react-admin.
As per documentation it goes through clumsy make process.
Have anybody installed the folder itself by just npm install and run?
Any hints on how that can be simplified, to fork and create my own project?
Reference: https://github.com/marmelab/react-admin/tree/master/examples/demo
This is a mono repository which includes many packages. It uses learn and yarn workspaces. You'll have to use yarn.
There are several scripts inside the main package.json file which can help you start contributing without make. Each package inside packages can be built by running yarn build inside its folder.
To build all packages in one command, you can run ./node_modules/.bin/lerna run build inside the root folder.

Installing npm package from fork with yarn + webpack - Can't resolve './dist/

I want to contribute to an open source React Component and I'd like to use a fork of the project in my webpack bundle.
I am using yarn and I tried to install my fork using
yarn add github:Startouf/react-coverflow
However, when webpack tries to compile my bundle, it raises weird errors
ERROR in ./~/react-coverflow/main.js
Module not found: Error: Can't resolve './dist/react-coverflow' in '/Users/Cyril/dev/MyApp/client/node_modules/react-coverflow'
Did I miss something ?
EDIT : when I use the released package from npm, the node module folder contains
LICENSE README.md dist main.js package.json
When I use my fork, it seems like the project isn't compiled and contains
LICENSE README.md package.json src webpack.config.js
Makefile main.js site test
Seems like I'm missing a step... I though doing yarn add with a github fork would automatically make a release but seems like I'm wrong ?
Unfortunately, using a repository directly as source can result in execution error. This is because it's not bundled at all, while the package expects an prebuilt version existing in dist. The bundling scripts are often executed before publishing releases to npm.
Some workarounds are:
execute the prepublish step in the target directory (this depends on
what the project uses)
of course, using the published version is the best. create your own package on npm and upload it.
References: npm issue
The package should be updated to include a prepare step.
A prepare step does exactly what you want in all cases.
https://stackoverflow.com/a/57503862/4612476
You can add the prepare script in package.json#scripts yourself that runs the build. Npm and Yarn will then automatically run the prepare script on install directly from GitHub. You can then treat it like any other package and it will always just work™.
Don't forget the package.json#files section. See the linked answer for more details.

create-react-app: Template was precompiled with an older version of Handlebars

I just installed create-react-app package following the instructions on https://github.com/facebookincubator/create-react-app.
After that I've followed the instructions and created a "myapp" app:
$ create-react-app --version
1.0.4
$ create-react-app myapp
Creating a new React app in /home/...mydir.../myapp.
Installing packages. This might take a couple minutes.
Installing react-scripts...
After the list of installed packages I've got:
Success! Created myapp at /home/...mydir.../myapp
Inside that directory, you can run several commands:
npm start
Starts the development server.
npm run build
Bundles the app into static files for production.
npm test
Starts the test runner.
npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd myapp
npm start
Happy hacking!
Ok, but when I'm running the server I've got the following message on browser console:
Template was precompiled with an older version of Handlebars than the current
runtime. Please update your precompiler to a newer version (>= 4.0.0) or downgrade
your runtime to an older version (>= 2.0.0-beta.1).
I've verified the handlebars version :
$ npm ls|grep handlebars
│ │ └─┬ handlebars#4.0.6
I've also tried to set the handlebars version on package.json under "devDependencies" and "dependencies" but that didn't work.
Any ideas on how to solve this?
This is a bug in Code Climate Chrome extension.
If you uninstall it, the error will go away.

Angular Gulp setup with latest NodeJS version

I have been following the repo A healthy Gulp Setup for the gulp setup of my AngularJS project.
I can successfully proceed with this in an older version of nodejs. But on my another system, I have installed a newer version "NodeJS 4.2.2" and I get many dependency errors.
At initial try of npm install I got the error
npm WARN engine karma#0.10.10: wanted: {"node":"~0.8 || ~0.10"} (current: {"node
":"4.2.2","npm":"2.14.7"})
I tried modifying the karma version in package.json from 0.10 to 0.13. This time the npm install hangs for hours while processing bufferutil.
C:\wamp\www\ros_ui\node_modules\karma\node_modules\socket.io\node_modules\socket
.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil
>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_mo
dules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
) else (node rebuild )
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
bufferutil.cc
win_delay_load_hook.c
Creating library C:\wamp\www\ros_ui\node_modules\karma\node_modules\socket
.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\
ws\node_modules\bufferutil\build\Release\bufferutil.lib and object C:\wamp\ww
w\ros_ui\node_modules\karma\node_modules\socket.io\node_modules\socket.io-cli
ent\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil\bui
ld\Release\bufferutil.exp
Generating code
Finished generating code
bufferutil.vcxproj -> C:\wamp\www\ros_ui\node_modules\karma\node_modules\sock
et.io\node_modules\socket.io-client\node_modules\engine.io-client\node_module
s\ws\node_modules\bufferutil\build\Release\\bufferutil.node
Is there any work around for this? I would prefer going with latest node version.
Any help would be appreciated. Thanks in Advance.
Try angularcoffee-boilerplate, this is a project template for AngularJS where npm and Gulp are preconfigured. Just clone the project, install prerequisites with the script install_prerequisites.bat and start the server with the command npm start

Resources