Elm 'hello world' example fails when installing elm-html - elm

Trying a hello world example with Elm 0.17
-- Main.elm
import Html exposing (text)
main =
text "Hello, World!"
justin#justin-ThinkPad-X240:~/work/hello_world_elm$ elm make Main.elm --output=index.html
Some new packages are needed. Here is the upgrade plan.
Install:
elm-lang/core 4.0.0
Do you approve of this plan? (y/n) y
Downloading elm-lang/core
Packages configured successfully!
I cannot find module 'Html'.
Module 'Main' is trying to import it.
Potential problems could be:
* Misspelled the module name
* Need to add a source directory or new dependency to elm-package.json
justin#justin-ThinkPad-X240:~/work/hello_world_elm$ elm package install evancz/elm-html
To install evancz/elm-html I would like to add the following
dependency to elm-package.json:
"evancz/elm-html": "4.0.2 <= v < 5.0.0"
May I add that to elm-package.json for you? (y/n) y
Error: Unable to find a set of packages that will work with your constraints.
justin#justin-ThinkPad-X240:~/work/hello_world_elm$
Any ideas what I might be doing wrong ? Ubuntu 14.04, Elm 0.17 installed from npm
Thanks!

The package evancz/elm-html has been replaced by elm-lang/html in version 0.17. So you should install that.

Related

npx from command line does not find imports?

I'm trying to run a simple hello.ts script from command line. This works if the script has no dependencies:
npx ts-node hello.ts
But as soon as I start adding some dependencies...
import _ from 'lodash';
console.log('hello');
It fails:
Cannot find module 'lodash' or its corresponding type declarations.
It keeps failing even if I install the dependencies globally. So how do I tell npx (or ts-node for that matter) to consider globally installed dependencies?
Update
Using Node 16.9.1 (upgraded via Version Lens). The error seems to have disappeared after uninstalling/reinstalling the imported libraries a few times.
If you're using npm >=1.0, you can use npm link to create a local link to a package already installed globally. (Caveat: The OS must support symlinks.)
IE: npm install -g lodash && npm link lodash
However, this doesn't come without its problems.
npm link is a development tool. It's awesome for managing packages on your local development box. But deploying with npm link is basically asking for problems, since it makes it super easy to update things without realizing it.
As an alternative, you can install the packages locally as well as globally.
For additional information, see:
https://nodejs.org/en/blog/npm/npm-1-0-link/
https://nodejs.org/en/blog/npm/npm-1-0-global-vs-local-installation/
Are you using the n package by any chance? I used n to change from a newer version of node (16.2.0) to an older version of node (12.13.0), ran npm i and npx failed with a different error.
Using n to change back to 16.2.0 seems to have resolved the issue so I'm thinking perhaps it was an issue with package-lock.json or such

Cannot find module 'babel-preset-react-native'

I have recently integrated react-native-web into my native project and have included webpack. I've followed all the instructions listed here.
However, when trying to run using the webpack command listed on the bottom of that page, i keep getting the error:
ERROR in ./index.web.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module 'babel-preset-react-native' from '<*path to root*>'
I have the preset metro-react-native-preset already installed and my babel config looks like the following:
babel.config.js
module.exports = {
presets: ['module:metro-react-native-babel-preset']
};
Im currently using React Native 0.62
Could you try to install 'babel-preset-react-native'?
npm install --save -dev babel-preset-react-native
You said you've got metro-react-native-preset already installed but your config has metro-react-native-babel-preset - I assume that mismatch is just accidental?
Anyway, that's probably unrelated. Here's a few things to try:
Have you verified you've got 0.62 of react native installed? I.e. in the npm lock file, as maybe you're on an older version (pre 0.57) which uses that older plugin.
Have you got a .babelrc file too, perhaps, with the other plugin defined instead?
Similar to (1), have you tried to delete the lock file and/or node_modules folder and run npm install again from scratch so versions match up properly.

Could Not Find statisfactory version from options when trying to install fishtown-analytics/codegen

I'm upgrading my dbt version from 0.16.0 to 0.17.2, and trying to update our codegen package as well.
My packages YML looks like this:
packages:
- package: fishtown-analytics/codegen
version: 0.2.0
The error I receive is this:
$ dbt deps
Running with dbt=0.17.2
Encountered an error:
Version error for package fishtown-analytics/codegen: Could not find a satisfactory version from options: ['=0.2.0', '=0.0.4', '=0.0.4']
Any Ideas?
I Also had some local packages within the packages.yml file which were dependent on a bad version of fishtown-analytics/codegen. After, I fixed all the dependencies in the downstream packages files everything imported correctly.

Karma/Jasmine – cannot start testing with new Angular 5 project (due tot index.d.ts errors)

When starting the test with ‘ng test’, the Chrome browser won’t start. I get this weird message.
karma jasmine ERROR in node_modules/#types/jasmine/index.d.ts(138,47): error TS1005: ';' expected.
My Angular version is 5.2 with the CLI 1.7.4.
The browser won’t start if you have errors – that’s what you saw.
Solution 1 – for solving the symptom:
I had the same issue. It may help when you update the typescript and jasmine types like so:
$ npm install --save-dev typescript#2.7
$ npm install --save-dev #types/jasmine#2.8.4
Solution 2 – more fundamental:
1 – Create a new Angular 5 project. Verify that testing is possible: ‘$ ng test’.
2 – Check the mismatch in versions in your package.json file. Correct these versions of your project according to the new sample project you just created. Do this with ‘npm install --save (or --save-dev)' of the packages. That way you will update the package.json file.
Success!

Module not found when using flat-ui with webpack

I want to use flat-ui with webpack when installed with npm. I have created a test project. The last commit is before installing flat-ui. When I do install and use
require('flat-ui');
I get the error:
Module not found: Error: Cannot resolve module 'flat-ui'
In my research I found this gist but am not familiar enough with webpack to understand it well enough.
My goal is to use npm to install dependencies rather than clutter up my project.
'flat-ui' npm package is not official package. This package provides old version. ( issue )
You need to install 'designmodo-flat-ui' package.