SPFX Development environment trouble, has anyone seen lookups.flatmap error? - spfx

I recently replaced my workstation and started to begin test the new environment, however I have not been able to successfully run: yo#microsofst/sharepoint to begin scaffolding. below is what I have set up.
Node v 10.24.1 | NPM v 6.14.12
---
+-- #microsoft/generator-sharepoint#1.11.0
+-- #pnp/generator-spfx#1.16.1
+-- gulp#4.0.2
`-- yo#3.1.1
---
Running yo doctor
Running sanity checks on your system
√ No .bowerrc file in home directory
√ Global configuration file is valid
√ NODE_PATH matches the npm root
√ No .yo-rc.json file in home directory
√ Node.js version
√ npm version
√ yo version
Everything looks all right!
running yo
TypeError: lookups.flatMap is not a function
at Environment.resolver.lookup enter code here

Looks like you are not alone. Same question is asked here this morning. I had the same error this morning when I was setting up a new environment:
For some reason, downgrading yeoman from 4.0.0 to 3.1.1 version fixed the issue. But it looks like your package versions are identical:
+-- #microsoft/generator-sharepoint#1.11.0
+-- #pnp/generator-spfx#1.16.1
+-- gulp#4.0.2
+-- npm#6.14.11
`-- yo#3.1.1
Perhaps, you can also try 10.24.0 nodejs instead of 10.24.1.

Related

wheel pollutes project folder with build & project.egg-info

I use the pip install c:\path\to\project command to install my local package from a pyproject.toml configuration. It works fine and I can also uninstall the package with pip uninstall project. The only thing that makes me unhappy is the project folder being polluted with two extra folders: build & project.egg-info. The same happens when I try to build it with python -m pip wheel . -w .dist. Is there any way to suppress or modify this behavior and keep the project folder clean?
project
|- pyproject.toml
|- project/
| | - test.py
|- build/ <-- extra folder
|- project.egg-info/ <-- extra folder

I need some with install or creating an app using terminal from Mac

I am new to this world of PHP, javascript, app creating, and working in the terminal from my Mac. If you respond please dumb it down for me. Just what to be real with my level.
I have been trying to get the JCOW app up, here is where I am at; Create a new expo project (Example name: myapp)
expo init myapp
cd myapp
Once I do this it asks for me to choose a template but the problem is the next step from the instructions doesn't mention this. They say: Import Jcow React Native source code
Unzip your Jcow Ultimate Edition, you get a "mobile" folder. Copy files from that folder to "myapp". Use npm install to install dependencies from package.json.
Edit config.tsx, set the value of url to your own Jcow website URL.
I have selected the: Choose a template: › minimal bare and minimal, just the essentials to get you started
When I move to the next instruction: Test your app
Run `expo start' to start development server and you will see a QR code on commend line terminal. Search and install "Expo" app from app store. Scan the QR code using Expo app and you will open your app. While testing your app, you should create at least 3 screenshots that will be used when submitting app.
Type in "start expo" here is what I get: Cannot determine which native SDK version your project uses because the module expo is not installed. Please install it with yarn add expo and try again.
├─ getExpoSDKVersion /usr/local/lib/node_modules/expo-cli/node_modules/#expo/config/src/Project.ts:23:9
├─ ensureConfigHasDefaultValues /usr/local/lib/node_modules/expo-cli/node_modules/#expo/config/src/Config.ts:478:18
├─ fillAndReturnConfig /usr/local/lib/node_modules/expo-cli/node_modules/#expo/config/src/Config.ts:103:10
├─ getConfig /usr/local/lib/node_modules/expo-cli/node_modules/#expo/config/src/Config.ts:179:10
├─ /usr/local/lib/node_modules/expo-cli/src/commands/utils/profileMethod.ts:16:21
├─ action /usr/local/lib/node_modules/expo-cli/src/commands/start.ts:29:24
├─ /usr/local/lib/node_modules/expo-cli/src/commands/start.ts:124:22
└─ expo start /usr/local/lib/node_modules/expo-cli/src/exp.ts:347:7
Any idea or help would be great. Thanks in Advance.

aws "serverless invoke local" fails to run when node_modules are on a parent folder

I have a serverless aws app within a context of many other ones. All of the node_modules are shared in a parent folder, and it works fine with deploys and invoke functions, not with invoke local. This is my structure:
main/
- node_modules
- serverless
- app1
- app2
- serverless.yml
serverless.yml file settings:
package:
include:
- ../../node_modules/**
The problem is whenever I try to run sls invoke local I got a error messages due to package not found. So, the workaround is to npm install --save every package that is outside of my path.
If you have found a solution, not a workaround (like mine) please share :).
It was so obvious I wanted to delete my question, but I'll leave the answer here>
just go to the folder that contains your node_modules, you'll find a package.json there, and run npm install --save for the new packages you need.
cd ../../
npm install --save missing_packages
your serverless.yml include should consider it when running local with no issues.
Violá!

typescript unable to find modules on windows?

I've got the following errors being emitted from webpack dev server, I didn't get these errors before I migrated to windows.
[default] C:\Users\xeno\IdeaProjects\rpf-ui\custom_typings\fetch.d.ts:1:1
File 'C:/Users/xeno/IdeaProjects/rpf-ui/node_modules/#types/whatwg-fetch/index.d.ts' not found.
[default] C:\Users\xeno\IdeaProjects\rpf-ui\src\security\register\RegistrationSvc.ts:4:45
Cannot find module 'src/security/authn/credentials/UsernamePasswordCredentials'.
[default] C:\Users\xeno\IdeaProjects\rpf-ui\typings\globals\whatwg-fetch\index.d.ts:88:11
Cannot find name 'ReadableStream'.
[default] Checking finished with 3 errors
I had more failures before I ran this. Worth saying all of those files are available at those locations, though I'm concerned that they're being shown with / and not \ since this is on windows and wasn't happening on linux.
that said my versions all look more recent than what I was running on linux.
npm -v && au --version && npm list typescript aurelia-framework webpack
3.10.3
0.18.0
rpf#0.1.12 C:\Users\xeno\IdeaProjects\rpf-ui
+-- aurelia-framework#1.0.2
+-- typescript#2.0.2
+-- typings#1.3.3
| `-- typings-core#1.4.1
| `-- typescript#1.8.7
`-- webpack#2.1.0-beta.21
how can I fix these errors? warnings? I can add information, but I'm not sure what's relevant.
Too ensure your using the same versions as you were on Linux I would go back to that working version of the project on that other dev enviroment and run npm shrinkwrap.
This will create a npm-shrinkwrap.json. With this new file go back to your Windows dev environment delete the local node_modules directory and run npm cache clean.
Then go about reinstalling the modules with npm install.
Also check you're running the same version of node and au as you were on the Linux environment.
Failing that it's likely an issue with one of the modules you're using not using the path module to sanitize file paths across platforms.
In which case I would recommend running a seperate developer enviroment on Windows within a VM / Container (Vagrant, Docker), or try using bash for Windows as your shell.

npm windows install globally results in npm ERR! extraneous

I am trying some "cookbook-examples" on the site 'http://tech.pro/tutorial/1190/package-managers-an-introductory-guide-for-the-uninitiated-front-end-developer#front_end_developers'.
You should not have to look there now, but I thought it could be good to share the site.
So far so good, til it comes to the global installing.
When it comes to the point trying to install something globally I get stuck.
What I did so far for testing globally installing some package:
Created test-directory grunttest
Inside that directory:
npm install -g jshint
Output I can see:
npm http GET https://registry.npmjs.org/jshint
npm http 304 https://registry.npmjs.org/jshint
...
npm http 304 https://registry.npmjs.org/string_decoder
C:\Program Files\nodejs\node_modules\npm\jshint -> C:\Program Files\nodejs\node_modules\npm\node_modules\jshinnt
jshint#2.4.4 C:\Program Files\nodejs\node_modules\npm\node_modules\jshint
├── console-browserify#0.1.6
├── exit#0.1.2
├── underscore#1.4.4
├── shelljs#0.1.4
├── minimatch#0.2.14 (sigmund#1.0.0, lru-cache#2.5.0)
├── cli#0.4.5 (glob#3.2.9)
└── htmlparser2#3.3.0 (domelementtype#1.1.1, domutils#1.1.6, domhandler#2.1.0, readable-stream#1.0.26-2)
I just realize the 304, which should be ok, due to just says the resource was not modified since last installation (few minutes before).
Checking if the jshint exists with:
`npm -global list`
Output:
npm#1.4.3 C:\Program Files\nodejs\node_modules\npm
├── abbrev#1.0.4
├── ansi#0.2.1
├─...
├──
├── graceful-fs#2.0.2
├── inherits#2.0.1
├── ini#1.1.0
├─┬ init-package-json#0.0.14
│ └── promzard#0.2.1
├─┬ jshint#2.4.4 extraneous
│ ├─┬ cli#0.4.5
│ │ └─┬ glob#3.2.9
│ │ └── inherits#2.0.1
│ ├── console-browserify#0.1.6
│ ├── exit#0.1.2
│ ├─┬ htmlparser2#3.3.0
│ │ ├── domelementtype#1.1.1
│ │ ├── domhandler#2.1.0
│ │ ├── domutils#1.1.6
│ │ └─┬ readable-stream#1.0.26-2
│ │ └─... ├── text-table#0.2.0
├── uid-number#0.0.3
└── which#1.0.5
**npm ERR! extraneous: jshint#2.4.4 C:\Program Files\nodejs\node_modules\npm\node_modules\jshint npm**
Questions:
Why do I get npm ERR! extraneous ...?
What does it mean?
How can I resolve this issue?
Information:
I am on a windows-machine Windows 7, using cygwin as shell.
trying to just the jshint (jshint someTestfile.js) of course does not work.
npm ERR! extraneous means a package is installed but is not listed in your project's package.json.
Since you're listing packages that have been installed globally, it's going to give you a lot of extraneous errors that can be simply ignored because most things installed globally will not be in your project's package.json.
1 & 2: It means you don't have the jshint listed in your project's package.json file but that it is globally installed. So it is not a big problem.
3: To avoid this extraneous error, you can run or re-run the install with the option --save . This will update automatically you package.json file :
npm install -g jshint --save
Or need to update manually your package.json file with a "dependencies": {...}
I resolved this by doing an npm update in the parent package's folder which removed some of the extraneous packages from the list and then did npm uninstall <package> for the remaining few.
Seems to have worked, as I'm getting no errors after doing this.
I solved it by combining all the answers. At first I installed the package globally.
npm install -g packagename --save
Since npm installed this packaged as well globally but did not add it to my local package.json file, I had to do something about it.
I choose, the solution to remove the local one and then install it globally.
npm uninstall packagename
npm install -g packagename
This way I have no more warnings and do not mess up the package.json file.
I my case, I saw this 'npm ERR! extraneous' message in my cygwin terminal when i did an 'npm ls'. I thought this was some sort of a globally corrupted setup after having lots of tinkering. I learn the following observations here:
'npm ls' gives different outputs depending on what is your current folder location.
'npm ls' tries to detect the presence of a 'node_modules' folder in the current folder location, and list out those contents. NOT the global ones!
Furthermore, if the current folder containing 'node_modules' also has a package.json file containing fewer modules listed here, then the error shows.
I 'rm package.json' and 'npm ls' no longer shows error message. So I say, that always check the current location for the presence of 'node_modules' folder and the package.json file because these are prioritize first in the check and if these are missing, the check continues to to the parent folder and so on, and if you have tinkered a lot of code snippets a lot, then you may have scattered around lots and lots of node_modules folder and package.json file. Nothing is really corrupted here, unlike those experiences we have when doing J2EE Java development / eclipse IDE or during the days when we have to use regedit to change settings in Windows.
In my case it was because the package name in its package.json file was not the same as the depency name listed in the package.json of the dependent module. My error, since it's a new module I created, but hard to spot, since npm won't give any clue.
This happened when using the dependencies: { "my-module": "file:local-modules/mymodule" } syntax, with a typo in the name "my-module".
This is due to the fact that your package is not in your package.json. If you add it, the problem will be solved, please look at the image below:

Resources