Comments (5)
I think we miss some polishing for development on windows. Especially powershell - I wish somebody told me to use cmd instead. Would have spared me an hour.
As you did, I grabbed the newest version of the plugin generator, left everything untouched and the plugin does not compile either. If I workaround the issues (missing node_modules folder, failing npm install) I am ending up with the same behaviour: plugin looks for command in 'lib' and there's no lib folder to be found.
from sfdx-plugin-generate.
I have the same problem when I try to install a new plugin from a tarball on Mac or Windows. The prepare script seems to be the cause of this issue.
It deletes the lib directory and then calls the compiler. Since the src directory does not exist in the tarball, nothing is compiled and the plugin is not working.
But the behavior is different depending on the platform the plugin was created on.
On a Mac this script is created:
"prepare": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme && npm shrinkwrap"
On Windows the rm command is not recognized (even PowerShell doesn't know the parameter -rf). This means on Windows the plugins works. But you will always get some yarn errors during the installation.
On MacOS rm -rf is executed with the result described above.
On Windows this script looks different:
"prepare": "rimraf lib && tsc -b && oclif-dev manifest && oclif-dev readme && npm shrinkwrap"
As rimraf is the UNIX command rm -rf for Node.js the lib directory will be removed on Windows as well as MacOS and the plugin is not working.
As a workaround you need to remove rimraf/rm-rf and tsc -b from the prepare script and build everything upfront.
from sfdx-plugin-generate.
My current solution to delete the lib folder and call the compiler within the prepare script during development and not if the plugin is published or packed:
install path-exists-cli
npm install --save-dev path-exists-cli
add a prepack script:
"prepack": "rimraf lib && tsc -b && oclif-dev manifest && oclif-dev readme && npm shrinkwrap ",
and modify the prepare script:
"prepare": "path-exists src && rimraf lib && tsc -b && oclif-dev manifest && oclif-dev readme && npm shrinkwrap || path-exists lib",
from sfdx-plugin-generate.
Ill give this a try, @jayree . Thx
@amphro could you still have look on getting started on Win as easily as on Mac? Thank you.
from sfdx-plugin-generate.
Can you try this with the latest CLI and build?
from sfdx-plugin-generate.
Related Issues (20)
- Errors thrown via SfdxError are not appearing: sfdx xyz:myplugin:set -u alias -p=xyz HOT 2
- No documentation for testing HOT 4
- Error thrown when running tests
- Mismatched version in @oclif/plugin-warn-if-update-available & @oclif/plugin-not-found HOT 2
- Wrong type definitions fetched for DescribeGlobalResult and DescribeGlobalSObjectResult HOT 3
- hello:org does not work HOT 2
- hello:org example does not work HOT 3
- Generated plugin fails when linking HOT 1
- Version of Node required is different to developer guide HOT 1
- plugin help shows <%= command.id %> instead of hello:org HOT 3
- MissingBundleError Plugin: XXX Missing bundle for locale en_US. HOT 5
- yarn run prepack fails for newly generated plugin HOT 5
- Documentation still refers to "yarn prepare" instead of "yarn prepack" HOT 1
- vscode debugging is broken HOT 1
- Guide to create a new Plugin is not working - Globby Missing Dependency HOT 1
- Template Output: `npm run test` gives little output / as if no tests ran. HOT 4
- Error: command hello:org not found HOT 12
- Error: command hello:org not found caused by incorrect folder structure on plugin HOT 3
- Unable to build (tsc) sfdx plugin for a few days
- Errors publishing freshly scaffolded plug-in HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sfdx-plugin-generate.