Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gulp build fails with an error #1

Closed
hlide opened this issue Jul 21, 2017 · 11 comments
Closed

gulp build fails with an error #1

hlide opened this issue Jul 21, 2017 · 11 comments

Comments

@hlide
Copy link

hlide commented Jul 21, 2017

GULP fails to build.

I installed GULP through npm install gulp in the root directory.

Windows 10 64-bit:

  • Node.js version: v6.11.1
  • NPM version: 3.10.10
  • GULP CLI & Local versions: 3.9.1

When I type gulp build in the root directory, I get:

C:\GIT\chartjs-plugin-datalabels>gulp build
module.js:471
    throw err;
    ^

Error: Cannot find module 'yargs'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\GIT\chartjs-plugin-datalabels\gulpfile.js:3:28)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

I was hoping to get it as Chart.js pie or bar fail to draw labels inside or outside (I want their percent values displayed so I can print them) but it looks as if that plugin is not supported any longer.

@simonbrunel
Copy link
Member

It works for me on Windows 10 64-bit +Node 6.9.2 + npm 3.10.9 + Gulp 3.9.1:

> git clone [email protected]:chartjs/chartjs-plugin-datalabels.git
> cd chartjs-plugin-datalabels
> npm install
> gulp build

This plugin is pretty new and requires Chart.js 2.7 which is not released yet (so you will also have to build it from master). Definitely not ready for production but any help testing this plugin is of course appreciated :)

@hlide
Copy link
Author

hlide commented Jul 21, 2017

I was able to build after manually 'npm install'-ed any missing requirements before running gulp build. I already did build Chart.js from github (master branch) since it was the only way to get chart.bundle.min.js. I must admit I had some warnings when building but so far I'm able to use chart.bundle.min.js and yours.

@simonbrunel
Copy link
Member

npm install takes care of all dependencies, even gulp.

What kind of warnings did you see when building?

@hlide
Copy link
Author

hlide commented Jul 21, 2017

Another thing due to my first time dealing with Node.js. It looks like when you open a console, you need to reinstall gulp and I didn't try to build first Chart.js then yours in the same console.

@hlide
Copy link
Author

hlide commented Jul 21, 2017

One example for your plugin:

C:\GIT\chartjs-plugin-datalabels>npm install gulp-file
[email protected] C:\GIT\chartjs-plugin-datalabels
+-- UNMET PEER DEPENDENCY chart.js@>= 2.7.0 < 3
`-- [email protected]

@simonbrunel
Copy link
Member

simonbrunel commented Jul 21, 2017

You don't need to install each dependency manually, simply run npm install in the root folder.

UNMET PEER DEPENDENCY chart.js@>= 2.7.0 < 3 warning means that if you create a Node.js project that depends on chartjs-plugin-datalabels, then your project also needs to depend on chart.js at a version between 2.7.0 and 3. But since you are not creating any project and directly build this plugin, you can safely ignore that warning.

@hlide
Copy link
Author

hlide commented Jul 21, 2017

I retried to install gulp (npm install gulp), here is what I got:

C:\GIT>npm install gulp
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
C:\GIT
`-- [email protected]
  +-- [email protected]
  +-- [email protected]
  | +-- [email protected]
//... edited ...
    |   `-- [email protected]
    `-- [email protected]
      `-- [email protected]

npm WARN enoent ENOENT: no such file or directory, open 'C:\GIT\package.json'
npm WARN GIT No description
npm WARN GIT No repository field.
npm WARN GIT No README data
npm WARN GIT No license field.

C:\GIT>npm ls graceful-fs
C:\GIT
+-- [email protected]
| `-- [email protected]
|   +-- [email protected]
|   | `-- [email protected]
|   |   `-- [email protected]
|   |     `-- [email protected]
|   |       `-- [email protected]
|   `-- [email protected]
`-- [email protected]
  `-- [email protected]

I made it on my GIT folder which contains all the git repositories so the last warnings are normal.

Is it normal that we have the first warnings? I had them when dealing with both Char.js (first to be built) and chartjs-plugin-datalabels (second to be built - gulp was absent so I needed to install it again, but even reinstalled, gulp build failed because of some requirements).

@simonbrunel
Copy link
Member

simonbrunel commented Jul 21, 2017

Don't worry about these warnings, I will check which modules need to be updated, but right now there is no repercussion on the generated chartjs-plugin-datalabels*.js.

About gulp, you don't need to install it manually but simply run npm install in C:\GIT\chartjs-plugin-datalabels, then the gulp command should become available. You only have to do that one time after cloning the project. If the project dependencies change, you will need to do npm update in the same folder.

@simonbrunel
Copy link
Member

simonbrunel commented Jul 21, 2017

You might also need to install gulp-cli globally: npm install gulp-cli -g

@simonbrunel
Copy link
Member

@hlide any progress, can we close this ticket? FYI, you don't need to build this plugin anymore, you can directly grab the development build (minified).

@hlide
Copy link
Author

hlide commented Aug 30, 2017

sure, let us close it

@hlide hlide closed this as completed Aug 30, 2017
santam85 referenced this issue in santam85/chartjs-plugin-datalabels Oct 28, 2020
Porting to CHART.JS 3 (dist/master) distribution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants