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

Can't copy files #1756

Open
bryant-the-coder opened this issue Nov 29, 2021 · 1 comment
Open

Can't copy files #1756

bryant-the-coder opened this issue Nov 29, 2021 · 1 comment

Comments

@bryant-the-coder
Copy link

bryant-the-coder commented Nov 29, 2021

Error i got:

Welcome to generator-html-scss-js...
Error html-scss-js

Trying to copy from a source that does not exist: C:\Users\User\.node_modules\node_modules\generator-html-scss-js\generators\app\templates\package-lock.json

My index.js:

const Generator = require("yeoman-generator");

module.exports = class extends Generator {
  welcome() {
    this.log("Welcome to generator-html-scss-js...");
  }

  writing() {
    this.fs.copy(
      this.templatePath("index.html"),
      this.destinationPath("index.html")
    );
    this.fs.copy(
      this.templatePath("gulpfile.js"),
      this.destinationPath("gulpfile.js")
    );
    this.fs.copy(
      this.templatePath("_gitignore"),
      this.destinationPath(".gitignore")
    );
    this.fs.copy(
      this.templatePath("package.json"),
      this.destinationPath("package.json")
    );
    this.fs.copy(
      this.templatePath("package-lock.json"),
      this.destinationPath("package-lock.json")
    );
    this.fs.copy(this.templatePath("app"), this.destinationPath("app"));
  }

  end() {
    this.log(" ");
    this.log(
      "Finished generating! Before running, make sure you have the Gulp CLI installed globally, and you do NOT have Gulp itself installed globally."
    );
    this.log(" ");
    this.log(
      "Once you have the Gulp CLI installed globally, run Gulp to start your day :)) !"
    );
    this.log(" ");
  }
};

Package.json in the templates folder

{
  "name": "testing",
  "version": "2.0.1",
  "description": "This is for people who do web development with html, scss and js",
  "main": "gulpfile.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Bryant Foo",
  "license": "ISC",
  "devDependencies": {
    "@babel/core": "^7.16.0",
    "@babel/preset-env": "^7.16.4",
    "autoprefixer": "^10.4.0",
    "browser-sync": "^2.27.7",
    "browserlist": "^1.0.1",
    "cssnano": "^5.0.12",
    "gulp": "^4.0.2",
    "gulp-babel": "^8.0.0",
    "gulp-dart-sass": "^1.0.2",
    "gulp-postcss": "^9.0.1",
    "gulp-sass": "^5.0.0",
    "gulp-terser": "^2.1.0",
    "postcss": "^8.4.4",
    "postcss-cli": "^9.0.2",
    "sass": "^1.43.5"
  }
}

Package.json in the root folder:

{
  "name": "generator-html-scss-js",
  "version": "4.4.8",
  "description": "This is for anyone who wanna use this for web development",
  "homepage": "",
  "author": {
    "name": "Bryant Foo",
    "email": "bryantfoo99@gmail.com",
    "url": "https://github.com/bryant-the-coder/generator-html-scss-js"
  },
  "files": [
    "generators"
  ],
  "main": "generators/index.js",
  "keywords": [
    "",
    "yeoman-generator"
  ],
  "devDependencies": {
    "coveralls": "^3.1.1",
    "eslint": "^8.3.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-config-xo": "^0.39.0",
    "eslint-plugin-prettier": "^4.0.0",
    "husky": "^7.0.4",
    "jest": "^27.3.1",
    "lint-staged": "^12.1.2",
    "prettier": "^2.5.0",
    "yeoman-assert": "^3.1.1",
    "yeoman-test": "^6.2.0"
  },
  "engines": {
    "npm": ">= 8.1.2"
  },
  "dependencies": {
    "chalk": "^5.0.0",
    "yeoman-generator": "^5.4.2",
    "yosay": "^2.0.2"
  },
  "jest": {
    "testEnvironment": "node"
  },
  "lint-staged": {
    "*.js": [
      "eslint --fix",
      "git add"
    ],
    "*.json": [
      "prettier --write",
      "git add"
    ]
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "eslintConfig": {
    "extends": [
      "xo",
      "prettier"
    ],
    "env": {
      "jest": true,
      "node": true
    },
    "rules": {
      "prettier/prettier": "error"
    },
    "plugins": [
      "prettier"
    ]
  },
  "scripts": {
    "pretest": "eslint .",
    "test": "jest"
  },
  "repository": "https://github.com/bryant-the-coder/generator-html-scss-js.git",
  "license": "Apache-2.0"
}

When i run yo html-scss-js (my generator), the error occur. I don't see anything wrong with it.

@bryant-the-coder
Copy link
Author

Please help as this is quite an important project to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant