Why does Yeoman generator not work when installed through npm? - github

Code
GitHub version: https://github.com/trevordmiller/generator-code-deck
npm version: https://www.npmjs.org/package/generator-code-deck
Background
I have built a Yeoman generator which is working perfectly locally (using npm link after cloning the repo from GitHub). However, when I npm publish the generator to npm and install it via npm install -g generator-code-deck, running the generator throws no such file or directory and cannot find module errors:
These errors don't make sense to me, because 1. the files and folders are obviously there (as shown by the screenshot doodles) and 2. the generator is working via a symbolic link to the local repo; why should the npm package be any different?
I have been searching online to find an answer but I can't find anything. Does anyone know why these errors are happening when trying to install via npm, but not via a symbolic link? Does anyone know how to fix this so that I can release the official npm version of the Yeoman generator? Any help would be much appreciated!

Chances are you're not publishing all files to npm.
This can be caused by a .npmignore file or by the files key of your package.json.

Related

How install npm dependency (rsuite) from github repository

I'm using next js 11.
I want to edit an rsuite component, so I understand that I need to clone the dependency https://github.com/rsuite/rsuite.git, and in my branch make the changes and then install it.
The problem is that while I can install the dependency ("rsuite": "MYUSER/rsuite"), not all files are installed.
Test installing then directly from rsuite, ("rsuite": "rsuite/rsuite") also probe, "rsuite": "git https://github.com/rsuite/rsuite.git" and other ways, (npm install https://github.com/rsuite/rsuite.git) and (yarn add https://github.com/rsuite/rsuite.git), but there is no case, not everything is installed, only some files.
Does anyone know how they could do it?
Thanks a lot.
image:
Because npm installation will read the information in package.json.
npm install https://github.com/rsuite/rsuite.git
The package.json files configuration is read when the above statement is executed.
So only the README and CHANGELOG files are available. In order to make it more convenient to import components in a modular manner, rsuite adopts the following methods to import.
import Button rsuite/Button
To implement such component import, we make a custom directory when rsuite is released. All components will be copied to the root directory and associated with the cjs and esm directories through soft links. Detailed release scripts can be viewed in the gulpfile configuration.

What code do I need to enter to make expo project function?

I am not a developer, but I had an app built a couple months ago. The developer we had won't help us at all anymore (not sure why).
Please excuse me if I don't use proper terms.
So the project was done on Expo. I no longer have access to the original expo project, but I have all the code he wrote in a Github repository.
Is is possible to take the code from Github and paste it into Expo XDE and possibly reproduce the app on Expo? (Or Does that sound possible?)
Please let me know.
Yes, you could do this. It is important, that you copy all project files from the GitHub repository into your new Expo project. Don't forget to download all necessary libraries into your new Expo project, e.g. via npm install.
I'm a complete react native noob, I've been doing this, and I love it:
Develop prototype on https://snack.expo.io
Here I can develop and test on the browser, test on my phones, and on emulators. It's great.
When I'm ready to build, I download the code package from the Snack IDE
This downloads a zip file with everything except Expo and imported libraries.
I unzip and go into the folder with my terminal and install the libraries.
Inside the folder, I run these commands to install Expo and the regular libraries:
$ npm install expo # install expo
$ npm install # install a bunch of required libraries
# Then I run these two lines until my project builds
$ npm run web # try to run - it will tell me which libraries to install, one by one
$ npm install <library> # install each library
Eventually I'll move to using command-line only, but this is both a no-brainer for a noob like me and it's like training wheels for me to learn npm and expo.

Component-preload.js generation

We are about to close a SAPUI5 application, one of the last steps is to make a Component-Preload.js file to improve performance. I read different guides around the web, all of them need Node.js that I have installed. I'm not expert about that package and I can't figure how to make one of that guides work. I'm developing with NetBeans. As far as I see there is not an official tool (am I right?) to generate that file. Can someone with more experience than me suggest a working, well-explained guide to perform that task?
I don't know if this could help, that's my working tree:
There are several main ways of doing it.
You can use SAP Web IDE to generate it. This assumes that you are using WebIDE to develop your application (which is not true based on your question). The regular version of WebIDE generates this file during the "client build" just before application deployment.
The "multi cloud" version of WebIDE can use a grunt build to do it. You can find more info here if you are interested: https://www.sap.com/developer/tutorials/webide-grunt-basic.html.
Use the new UI5 command line tools (https://npmjs.com/package/#ui5/cli):
Run npm i -g #ui5/cli to install the tools globally.
Open the root of your project with your terminal.
Run ui5 build preload to build the preload.
Use the #sap/grunt-sapui5-bestpractice-build pre-configured grunt tasks. The downside is that they are more-or-less black boxes which do not allow that much customisation. You can find an example setup on SAP's GitHub repository jenkins-pipelines. In a nutshell:
You need to define an .npmrc file which adds the #sap npm registry: #sap:registry=https://npm.sap.com.
Run a npm init command such that you generate a package.json file. This file describes your application and your dependencies (runtime dependencies and dev dependencies; you will only have dev dependencies for now, as you just want to build your app). Make sure to mark the package as private. See the npm docu (at the end of the license chapter).
Then you can install grunt and the build configuration: npm i grunt -D and npm i #sap/grunt-sapui5-bestpractice-build -D.
Lastly you need to define a simple Gruntfile (you can then run the build by just running grunt):
module.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('#sap/grunt-sapui5-bestpractice-build');
grunt.registerTask('default', [
'lint',
'clean',
'build'
]);
};
You can use the official grunt_openui5 plugin to generate the preload file(s). In order to be able to do this, you need to have node installed:
Create a package.json (e.g. through npm init).
Install grunt by writting in the console: npm install grunt-cli --save-dev.
Install the official openui5 grunt plugin: npm install grunt-openui5 --save-dev.
Now you have all the tools necessary, you just need to tell grunt what it has to do. You should create a Gruntfile.js in the root of your project. In this file you should configure the grunt openui5 task as described in the official github page (I linked it above). You can find a similar file here (it has more build steps like minification and copying the result files in a separate directory).
You can then run the grunt build by simply running grunt <task_name> in the console. If you registered your build task as the grunt default task (like in the sample file: grunt.registerTask('default', [...]);) then you just have to write grunt.
I think you should be able to integrate such a command line script (i.e. to run grunt) inside your IDE as an external tool.
You can use the unofficial gulp-openui5 tool to generate it. I would not recommend this if you are not already using gulp for your builds (as it is not a tool built by SAP). The procedure is the same, but using gulp for building the app instead of grunt (so you need to install node, npm init, install gulp, create the Gulpfile, etc).
Note that for most of the above methods, you need nodejs, which you can download and install from here: https://nodejs.org/en/download/.

Where do I find the latest versions of skulpt.min.js and skulpt-stdlib.js from GitHub?

I am looking for the latest versions of skulpt.min.js and skulpt-stdlib.js for my website. I am new to GitHub, and asked them. They said to make a new release. So I did. And I can't find the files I am looking for. Where could I find the latest releases?
The latest version of skulpt.js and skulpt-stdlib.js are now provided through bower, which is a package manager that keeps track of your packages and makes sure they're up to date.
Bower can be installed with npm running the command
npm install -g bower
From there you can get skult.js by running this command
bower install skulpt
If you don't want to use Bower, you can download it from here
Or you can get it as .zip or .tar.gz
Here: https://github.com/skulpt/skulpt/releases/tag/0.10.0
Look in the Downloads section. Here's the link: https://github.com/skulpt/skulpt/archive/0.10.0.zip
Note you'll have to build the project to get the .js files. See this https://github.com/skulpt/skulpt#building-skulpt for details.

Ember CLI Install Addon

can somebody tell me the difference between using ember install and npm install ... the docs are very slim in describing the exact function of ember install.
Does ember install, actually call npm install?
thanks
Essentially, yes, ember install <addon-name> does execute npm install --save-dev <addon-name>.
However, it'll also perform any necessary additional setup required by the "blueprint" or add-on hooks (adding bower dependencies, editing a .jshintrc file, or many other tasks). This might not be applicable to some add-ons, but it is a good idea to use ember install over npm install for add-ons.
Normal npm packages will be installed by using ember install, but they won't contain a blueprint - so basically it'd be the same as using npm install in that case.
From the docs:
ember install <addon-name> - Installs the given addon to your project and saves it to the package.json. It will run the addon’s defaultBlueprint if it provides one.
You can read more about blueprints here.
Hope this helps. I'm not sure this is thoroughly documented anywhere, this is just my understanding of the process from my usage.